fnc12 / sqlite_orm

❤️ SQLite ORM light header only library for modern C++
GNU Affero General Public License v3.0
2.26k stars 313 forks source link

create virtual table using rtree module #279

Open MelodyD opened 5 years ago

MelodyD commented 5 years ago

hi, i want create a virtual table by using rtree moudle.what should i do?

CREATE VIRTUAL TABLE table_demo USING rtree(id, minX, maxX, minY, maxY, +rowid INTEGER);
fnc12 commented 5 years ago

Hi. Looks like that first you need to register a rtree module. How do you expect to do it?

MelodyD commented 5 years ago

Hi. Looks like that first you need to register a rtree module. How do you expect to do it?

I have already registered rtree module and created virtual table succeeded by using CREATE VIRTUAL TABLE table_demo USING rtree(id, minX, maxX, minY, maxY, +rowid INTEGER); But i don't konw how to use this lib to do that, dose this lib support it?i like this lib

fnc12 commented 5 years ago

You know sometimes it happens when someone tells me about some SQLite feature I have never heard about. This case is exactly the same. I've never header about creating modules. So there is no such a feature. But I want to add it cause it looks pretty and useful. To understand it I need some example of modules creation and virtual table using in raw SQLite. There is not so much info in google. Could you please provide some? Thanks

MelodyD commented 5 years ago

thank you for your reply.my English is not good,sorry. you can get some info from this: https://sqlite.org/rtree.html this module can make sqlite create rtree index. it's a special index that is designed for doing range queries.usually used in Geographic Information System application. there also some other kind modules that i don't konw mush.

fnc12 commented 5 years ago

VIRTUAL TABLE looks like a very useful and very large feature. It is very interesting and useful to add it to sqlite_orm. I need to know more about it. I'm reading docs https://www.sqlite.org/fts3.html then I shall be able to tell you how and when I am going to implement it. It may not be so quickly cause I have primary job also which takes most of my time. Thanks for understanding. Also if you have some ideas about syntax please feel free to paste it here. Thanks again

spiritEcosse commented 2 years ago

Hello, as i understand virtual table will help with full text search ?

fnc12 commented 2 years ago

@spiritEcosse hello. I did not understand your question and why are asking it here. Do you want to implement full text search or coordinates search?

spiritEcosse commented 2 years ago

Sorry, i thought this issue related with full text search. Like in this article we can see support full text search. https://www.sqlite.org/fts5.html

spiritEcosse commented 2 years ago

maybe it is worth creating a separate issue?

fnc12 commented 2 years ago

there is already one https://github.com/fnc12/sqlite_orm/issues/622

fnc12 commented 11 months ago

FTS is implemented in dev branch. So the common mechanism of virtual tables in sqlite_orm is created. Soon I'll start implement rtree as well

fnc12 commented 11 months ago

@MelodyD do you have some example SQL code you would like sqlite_orm to support within RTree? I may help us adding unit tests and examples