4 ms·
Another exercise that's fun is playing with Sqlite virtual tables and/or the Sqlite VFS layer. Virtual tables: https://www.sqlite.org/draft/vtab.html https://w
by tyingq 8y ago
Another exercise that's fun is playing with Sqlite virtual tables and/or the Sqlite VFS layer.
Virtual tables: https://www.sqlite.org/draft/vtab.html https://www.sqlite.org/draft/vtab.html
A simple example of using VFS to add a useful feature: https://github.com/Metalnem/sqlite-vfsdemo https://github.com/Metalnem/sqlite-vfsdemo
- titanix2 8y agoThanks a lot. I planned to implement virtual SQL tables for a project and wasn’t aware of existing product. This probably will save me a lot of time.
- bshipp 8y agoDon't forget about the 'ATTACH DATABASE' option as well. It is great for linking up individual SQLite databases when you need to do a broad-based query across multiple sources. https://www.sqlite.org/lang_attach.html https://www.sqlite.org/lang_attach.html If you use a GUI front-end like SQLiteStudio (https://sqlitestudio.pl/ https://sqlitestudio.pl/), attaching databases is ridiculously easy to do. Just add the database name from the left column in front of the table or table.column label for the database you want to reference. Most SQLite GUI's will do the attach command for you internally. I add the database name to my queries instinctively now in SQLiteStudio, so that no matter which DB is currently in focus/opened the query runs on the one I intended it to run on.
- mappu 8y agoYou might also be interested in https://github.com/src-d/go-mysql-server https://github.com/src-d/go-mysql-server , a Go library for putting a MySQL-compatible frontend over a custom virtual data source.
- titanix2 8y agoI know nothing about Go but the project is indeed interesting. Thanks.
- charlysl 8y agoPavlo's CMU intro db course's labs are actually based on sqlite: https://youtu.be/vyVGm_2iFwU https://youtu.be/vyVGm_2iFwU https://15445.courses.cs.cmu.edu/fall2018/ https://15445.courses.cs.cmu.edu/fall2018/ https://github.com/Nov11/15-445 https://github.com/Nov11/15-445