@oino-ts/db-postgresql 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,76 @@
|
|
|
1
|
+
import { OINODb, OINODbParams, OINODbDataSet, OINODbApi, OINODataCell } from "@oino-ts/db";
|
|
2
|
+
/**
|
|
3
|
+
* Implementation of Postgresql-database.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare class OINODbPostgresql extends OINODb {
|
|
7
|
+
private _pool;
|
|
8
|
+
/**
|
|
9
|
+
* Constructor of `OINODbPostgresql`
|
|
10
|
+
* @param params database paraneters
|
|
11
|
+
*/
|
|
12
|
+
constructor(params: OINODbParams);
|
|
13
|
+
private _parseFieldLength;
|
|
14
|
+
private _query;
|
|
15
|
+
private _exec;
|
|
16
|
+
/**
|
|
17
|
+
* Print a table name using database specific SQL escaping.
|
|
18
|
+
*
|
|
19
|
+
* @param sqlTable name of the table
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
printSqlTablename(sqlTable: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Print a column name with correct SQL escaping.
|
|
25
|
+
*
|
|
26
|
+
* @param sqlColumn name of the column
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
printSqlColumnname(sqlColumn: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Print a single data value from serialization using the context of the native data
|
|
32
|
+
* type with the correct SQL escaping.
|
|
33
|
+
*
|
|
34
|
+
* @param cellValue data from sql results
|
|
35
|
+
* @param sqlType native type name for table column
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
printCellAsSqlValue(cellValue: OINODataCell, sqlType: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Parse a single SQL result value for serialization using the context of the native data
|
|
41
|
+
* type.
|
|
42
|
+
*
|
|
43
|
+
* @param sqlValue data from serialization
|
|
44
|
+
* @param sqlType native type name for table column
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
parseSqlValueAsCell(sqlValue: OINODataCell, sqlType: string): OINODataCell;
|
|
48
|
+
/**
|
|
49
|
+
* Connect to database.
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
connect(): Promise<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Execute a select operation.
|
|
55
|
+
*
|
|
56
|
+
* @param sql SQL statement.
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
sqlSelect(sql: string): Promise<OINODbDataSet>;
|
|
60
|
+
/**
|
|
61
|
+
* Execute other sql operations.
|
|
62
|
+
*
|
|
63
|
+
* @param sql SQL statement.
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
sqlExec(sql: string): Promise<OINODbDataSet>;
|
|
67
|
+
private _getSchemaSql;
|
|
68
|
+
/**
|
|
69
|
+
* Initialize a data model by getting the SQL schema and populating OINODbDataFields of
|
|
70
|
+
* the model.
|
|
71
|
+
*
|
|
72
|
+
* @param api api which data model to initialize.
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
initializeApiDatamodel(api: OINODbApi): Promise<void>;
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OINODbPostgresql } from "./OINODbPostgresql.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oino-ts/db-postgresql",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "OINO TS package for using Postgresql 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.
|
|
23
|
+
"@oino-ts/db": "0.1.3",
|
|
24
24
|
"pg": "^8.11.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|