# Nano Sqlite Functions and Classes for handle Sqlite in [Bun](https://bun.sh/). ## API ### getOrCreateSqlite(options = {}) As options the default Parameters from [Bun](https://bun.sh/docs/api/sqlite) are available. The uri of the Sqlite can be set in the .env-file, ``` NANO_SQLITE_PATH="./../storage/db.sqlite" ``` or by Parameter in options, ``` const db = getOrCreateSqlite({ uri: './../storage/db.sqlite' }) const db = getOrCreateSqlite({ uri: ':memory:' }) ``` Per Default WAL mode is enabled. To disable add Parameter "wal", ``` const db = getOrCreateSqlite({ path: './../storage/db.sqlite', 'wal': false }) ``` ### runMigrationSqlite(filePath: string, db: object) This functions Reads SQL-Files from a Directory and execute them in the Sqlite. ### Store Store is a Abstract Class to extend a Class for an Single Table. There are no functions to validating Columns. ``` class Store extends Store { constructor(db) { super(db, '') } } ``` #### findOneById(id: integer) Getting single row by Id. #### create(data: object) Create a new row in a Table. #### update(id: integer, data: object) Update single row by Id. #### remove(id: integer) Remove single row by Id.