[[!sidebar content=""]] [[!meta title="Using SQLite as a data source: a framework and an example"]] [[!meta copyright="Copyright © 2022 Andrew Hyatt"]] [[!inline pages="internal(2022/info/sqlite-nav)" raw="yes"]] # Using SQLite as a data source: a framework and an example Andrew Hyatt (he/him) [[!inline pages="internal(2022/info/sqlite-before)" raw="yes"]] Emacs can now be built with SQLite, giving native support for reading and writing to a database. With this, we can start seriously considering a SQLite-first approach: instead of storing data on the filesystem, and using various ad-hoc solutions for metadata, we can use SQLite to store and search our data. This is essentially a tradeoff between the power and speed of SQLite and the universality of the filesystem. If we accept that this approach is useful, then a standard way to store information in database, may be useful and promote package interoperability, just as our single filesystem does. The triples packages is a RDF-like database for supplying such a flexible system for storing and retrieving data from SQLite. A sample application, ekg, a replacement for org-roam, is shown using this, and the advantages of the triple design are explained. For more information and the packages discussed here, see the [triples](https://github.com/ahyatt/triples) and [ekg](https://github.com/ahyatt/ekg) pages. [[!inline pages="internal(2022/info/sqlite-after)" raw="yes"]] [[!inline pages="internal(2022/info/sqlite-nav)" raw="yes"]] [[!taglink CategoryEmacsLisp]]