From 80f935415e7a76f3eb5df4bcf470a9762c203f88 Mon Sep 17 00:00:00 2001 From: HerrHase Date: Mon, 21 Oct 2024 09:26:47 +0200 Subject: [PATCH] remove safeIntegers true as default --- README.md | 7 ++----- package.json | 2 +- resources/itemStore.ts | 2 +- resources/items.sql | 4 ++-- src/sqlite.ts | 18 ++++-------------- 5 files changed, 10 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3710847..b678ea8 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,7 @@ Functions and Classes for handle Sqlite in [Bun](https://bun.sh/). ### 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, +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" @@ -32,9 +31,7 @@ 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. Set the name -of the table in super(). There is no handling of columns or validating if the -exists. +Store is a Abstract Class to extend a Class for an Single Table. Set the name of the table in super(). There is no handling of columns or validating if the exists. ``` class Store extends Store { diff --git a/package.json b/package.json index 892e0ef..7673f07 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nano/sqlite", - "version": "0.2.0", + "version": "0.2.1", "description": "Functions and Classes for handle sqlite in Bun", "repository": { "type": "git", diff --git a/resources/itemStore.ts b/resources/itemStore.ts index 3ff3fb0..7e6fcdd 100644 --- a/resources/itemStore.ts +++ b/resources/itemStore.ts @@ -5,7 +5,7 @@ import Store from './../src/Store.ts' * * @author Björn Hase * @license http://opensource.org/licenses/MIT The MIT License - * @link https://gitea.node001.net/HerrHase/urban-filehub.git + * @link https://git.node001.net/nano/sqlite.git * */ diff --git a/resources/items.sql b/resources/items.sql index dbed2c5..b310422 100644 --- a/resources/items.sql +++ b/resources/items.sql @@ -2,6 +2,6 @@ CREATE TABLE IF NOT EXISTS items ( id INTEGER PRIMARY KEY, name TEXT, description TEXT, - date_created_at TEXT, - date_upated_at TEXT + date_created_at NUMERIC, + date_upated_at NUMERIC ) diff --git a/src/sqlite.ts b/src/sqlite.ts index 5580d6d..54a827f 100644 --- a/src/sqlite.ts +++ b/src/sqlite.ts @@ -13,20 +13,10 @@ function getOrCreateSqlite(options = {}): Database { let db - // check version for merge options - // safeIntegers only aviable in version >= 1.1.14 - if (Bun.version < '1.1.14') { - options = Object.assign({ - uri: process.env.NANO_SQLITE_PATH, - wal: true - }, options) - } else { - options = Object.assign({ - uri: process.env.NANO_SQLITE_PATH, - wal: true, - safeIntegers: true - }, options) - } + options = Object.assign({ + uri: process.env.NANO_SQLITE_PATH, + wal: true + }, options) const uri = options.uri delete options.uri