magic.lambda.sqlite - Using SQLite from Hyperlambda
This is the SQLite data adapter for Magic. This project allows you to provide a semantic lambda structure to its slots, which in turn will dynamically create a SQLite dialect SQL statement for you, for all basic types of CRUD SQL statements. In addition, it provides slots to open a SQLite database connection, and such allows you to declare your own SQL statements to be executed towards a SQLite database. Slots this project contains are as follows.
- [sqlite.connect] - Connects to a database
- [sqlite.create] - Creates a single record in the specified table
- [sqlite.read] - Reads multiple records from the specified table
- [sqlite.update] - Updates a single record in the specified table
- [sqlite.delete] - Deletes a single record in the specified table
- [sqlite.select] - Executes an arbitrary SQL statement, and returns results of reader as lambda objects to caller
- [sqlite.scalar] - Executes an arbitrary SQL statement, and returns the result as a scalar value to caller
- [sqlite.execute] - Executes an aribitrary SQL statement
- [sqlite.transaction.create] - Creates a new transaction
- [sqlite.transaction.commit] - Explicitly commits an open transaction
- [sqlite.transaction.rollback] - Explicitly rolls back an open transaction
- [sqlite.connections.flush] - Flushed cached schemas and connection pools
Notice - If you use any of the CRUD slots from above, the whole idea is that you can polymorphistically use the same lambda object, towards any of the underlaying database types, and the correct specific syntax for your particular database vendor’s SQL syntax will be automatically generated. This allows you to transparently use the same lambda object, towards any of the database types Magic supports, without having to change it in any ways.
All of the slots in this project are documented in the documentation for the “magic.data.common” project. If you replace the [data.xxx] or [sql.xxx] slots with [sqlite.xxx], you will use the sqlite specific slots, instead of the generic, and/or polymorphistic slots. Hence, please refer to the documentation for “magic.data.common” to see the complete documentation for this project. If you need for instance documentation about the [sqlite.connect] slot you should look for the documentation for [data.connect], since it’s more or less the exact same documentation.
Project website for magic.lambda.sqlite
The source code for this repository can be found at github.com/polterguy/magic.lambda.sqlite, and you can provide feedback, provide bug reports, etc at the same place.
Copyright and maintenance
The projects is copyright of Aista, Ltd 2021 - 2023