@oino-ts/db-bunsqlite 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,77 @@
1
+ import { OINODb, OINODbParams, OINODbDataSet, OINODbApi, OINODataCell } from "@oino-ts/db";
2
+ /**
3
+ * Implementation of BunSqlite-database.
4
+ *
5
+ */
6
+ export declare class OINODbBunSqlite extends OINODb {
7
+ private static _tableDescriptionRegex;
8
+ private static _tablePrimarykeyRegex;
9
+ private static _tableForeignkeyRegex;
10
+ private static _tableFieldTypeRegex;
11
+ private _db;
12
+ /**
13
+ * OINODbBunSqlite constructor
14
+ * @param params database parameters
15
+ */
16
+ constructor(params: OINODbParams);
17
+ private _parseDbFieldParams;
18
+ /**
19
+ * Print a table name using database specific SQL escaping.
20
+ *
21
+ * @param sqlTable name of the table
22
+ *
23
+ */
24
+ printSqlTablename(sqlTable: string): string;
25
+ /**
26
+ * Print a column name with correct SQL escaping.
27
+ *
28
+ * @param sqlColumn name of the column
29
+ *
30
+ */
31
+ printSqlColumnname(sqlColumn: string): string;
32
+ /**
33
+ * Print a single data value from serialization using the context of the native data
34
+ * type with the correct SQL escaping.
35
+ *
36
+ * @param cellValue data from sql results
37
+ * @param sqlType native type name for table column
38
+ *
39
+ */
40
+ printCellAsSqlValue(cellValue: OINODataCell, sqlType: string): string;
41
+ /**
42
+ * Parse a single SQL result value for serialization using the context of the native data
43
+ * type.
44
+ *
45
+ * @param sqlValue data from serialization
46
+ * @param sqlType native type name for table column
47
+ *
48
+ */
49
+ parseSqlValueAsCell(sqlValue: OINODataCell, sqlType: string): OINODataCell;
50
+ /**
51
+ * Connect to database.
52
+ *
53
+ */
54
+ connect(): Promise<boolean>;
55
+ /**
56
+ * Execute a select operation.
57
+ *
58
+ * @param sql SQL statement.
59
+ *
60
+ */
61
+ sqlSelect(sql: string): Promise<OINODbDataSet>;
62
+ /**
63
+ * Execute other sql operations.
64
+ *
65
+ * @param sql SQL statement.
66
+ *
67
+ */
68
+ sqlExec(sql: string): Promise<OINODbDataSet>;
69
+ /**
70
+ * Initialize a data model by getting the SQL schema and populating OINODbDataFields of
71
+ * the model.
72
+ *
73
+ * @param api api which data model to initialize.
74
+ *
75
+ */
76
+ initializeApiDatamodel(api: OINODbApi): Promise<void>;
77
+ }
@@ -0,0 +1 @@
1
+ export { OINODbBunSqlite } from "./OINODbBunSqlite.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oino-ts/db-bunsqlite",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "OINO TS package for using Bun Sqlite databases.",
5
5
  "author": "Matias Kiviniemi (pragmatta)",
6
6
  "license": "MPL-2.0",
@@ -20,7 +20,7 @@
20
20
  "module": "./dist/esm/index.js",
21
21
  "types": "./dist/types/index.d.ts",
22
22
  "dependencies": {
23
- "@oino-ts/db": "^0.1.2"
23
+ "@oino-ts/db": "^0.1.3"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^20.12.7",