开发者

Convert function Postgresql to Sqlite

开发者 https://www.devze.com 2023-03-03 09:38 出处:网络
I have a problem with my iPad app. I have to convert a PostgreSQ开发者_StackOverflow中文版L database to SQLite database. Luckily I did it but I didn\'t know how to convert the PostgreSQL functions. An

I have a problem with my iPad app. I have to convert a PostgreSQ开发者_StackOverflow中文版L database to SQLite database. Luckily I did it but I didn't know how to convert the PostgreSQL functions. Anyone knows how to did it? Or how can I get the same result in Sqlite?

Thanks in advance, Luca


As you allready discovered sqlite has no functions. So you will probably have to move some logic from the function and the single query out of your db into your app. This will probably mean executing a query looking at the result and based on that executing some more queries. So you can do the logic of the function in your app.

While this is not recommended in PostgreSQL as performance suffers from many small queries the performance loss in SQlite is much smaller as it is an embedded database (no communication overhead) and it's planner is more straight forward which makes the planning overhead of seperate queries smaller.

0

精彩评论

暂无评论...
验证码 换一张
取 消