@fastrack/starter-db-oracle 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +21 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +77 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +37 -0
- package/src/index.ts +5 -0
- package/src/oracledb.d.ts +18 -0
- package/src/plugin.ts +83 -0
- package/tsconfig.json +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Fastrack
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Static } from "@sinclair/typebox";
|
|
2
|
+
import type { FastrackStarter } from "@fastrack/core";
|
|
3
|
+
export declare const OracleStarterConfigSchema: import("@sinclair/typebox").TObject<{
|
|
4
|
+
connectionString: import("@sinclair/typebox").TString;
|
|
5
|
+
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
6
|
+
password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
|
+
poolMin: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
8
|
+
poolMax: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
9
|
+
}>;
|
|
10
|
+
export type OracleStarterConfig = Static<typeof OracleStarterConfigSchema>;
|
|
11
|
+
export interface OracleClient {
|
|
12
|
+
query(sql: string, params?: unknown[]): Promise<unknown[]>;
|
|
13
|
+
transaction<T>(fn: (tx: {
|
|
14
|
+
query: (sql: string, params?: unknown[]) => Promise<unknown[]>;
|
|
15
|
+
}) => Promise<T>): Promise<T>;
|
|
16
|
+
health(): Promise<{
|
|
17
|
+
ok: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
export declare const oracleStarter: FastrackStarter<OracleStarterConfig>;
|
|
21
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,gBAAgB,CAAC;AAGvE,eAAO,MAAM,yBAAyB;;;;;;EAMpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE3E,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3D,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;QAAE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;KAAE,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvH,MAAM,IAAI,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,aAAa,EAAE,eAAe,CAAC,mBAAmB,CA4D9D,CAAC"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import oracledb from "oracledb";
|
|
3
|
+
import { registerHealthContributor } from "@fastrack/starter-actuator";
|
|
4
|
+
export const OracleStarterConfigSchema = Type.Object({
|
|
5
|
+
connectionString: Type.String(),
|
|
6
|
+
user: Type.Optional(Type.String()),
|
|
7
|
+
password: Type.Optional(Type.String()),
|
|
8
|
+
poolMin: Type.Optional(Type.Number({ default: 0 })),
|
|
9
|
+
poolMax: Type.Optional(Type.Number({ default: 10 })),
|
|
10
|
+
});
|
|
11
|
+
export const oracleStarter = {
|
|
12
|
+
name: "db-oracle",
|
|
13
|
+
configSchema: OracleStarterConfigSchema,
|
|
14
|
+
defaults: { poolMin: 0, poolMax: 10 },
|
|
15
|
+
register(app, ctx, config) {
|
|
16
|
+
const poolConfig = {
|
|
17
|
+
user: config.user,
|
|
18
|
+
password: config.password,
|
|
19
|
+
connectString: config.connectionString,
|
|
20
|
+
poolMin: config.poolMin ?? 0,
|
|
21
|
+
poolMax: config.poolMax ?? 10,
|
|
22
|
+
};
|
|
23
|
+
let pool = null;
|
|
24
|
+
async function getPool() {
|
|
25
|
+
if (!pool)
|
|
26
|
+
pool = await oracledb.createPool(poolConfig);
|
|
27
|
+
return pool;
|
|
28
|
+
}
|
|
29
|
+
const client = {
|
|
30
|
+
async query(sqlText, params) {
|
|
31
|
+
const p = await getPool();
|
|
32
|
+
const conn = await p.getConnection();
|
|
33
|
+
try {
|
|
34
|
+
const result = await conn.execute(sqlText, params ?? []);
|
|
35
|
+
return (result.rows ?? []);
|
|
36
|
+
}
|
|
37
|
+
finally {
|
|
38
|
+
await conn.close();
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
async transaction(fn) {
|
|
42
|
+
const p = await getPool();
|
|
43
|
+
const conn = await p.getConnection();
|
|
44
|
+
try {
|
|
45
|
+
await conn.execute("BEGIN NULL; END;");
|
|
46
|
+
const tx = {
|
|
47
|
+
query: async (sqlText, params) => {
|
|
48
|
+
const result = await conn.execute(sqlText, params ?? []);
|
|
49
|
+
return (result.rows ?? []);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
const out = await fn(tx);
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
await conn.close();
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
async health() {
|
|
60
|
+
try {
|
|
61
|
+
const rows = await client.query("SELECT 1 FROM DUAL");
|
|
62
|
+
return { ok: Array.isArray(rows) && rows.length > 0 };
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return { ok: false };
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
app.decorate("oracle", client);
|
|
70
|
+
registerHealthContributor(app, "oracle", () => client.health());
|
|
71
|
+
ctx.onShutdown?.(async () => {
|
|
72
|
+
if (pool)
|
|
73
|
+
await pool.close(10);
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,MAAM,CAAC;IACnD,gBAAgB,EAAE,IAAI,CAAC,MAAM,EAAE;IAC/B,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAClC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACtC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IACnD,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;CACrD,CAAC,CAAC;AAUH,MAAM,CAAC,MA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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fastrack/starter-db-oracle",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@sinclair/typebox": "^0.34.34",
|
|
16
|
+
"fastify": "^5.1.0",
|
|
17
|
+
"oracledb": "^6.7.0",
|
|
18
|
+
"@fastrack/core": "0.1.0",
|
|
19
|
+
"@fastrack/starter-actuator": "0.1.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"typescript": "^5.6.3"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public",
|
|
26
|
+
"registry": "https://registry.npmjs.org/"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc -p tsconfig.json",
|
|
33
|
+
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
34
|
+
"lint": "echo ok",
|
|
35
|
+
"test": "echo ok"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare module "oracledb" {
|
|
2
|
+
export interface PoolAttributes {
|
|
3
|
+
user?: string;
|
|
4
|
+
password?: string;
|
|
5
|
+
connectString?: string;
|
|
6
|
+
poolMin?: number;
|
|
7
|
+
poolMax?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface Pool {
|
|
10
|
+
getConnection(): Promise<Connection>;
|
|
11
|
+
close(gracePeriod?: number): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export interface Connection {
|
|
14
|
+
execute(sql: string, params?: unknown[]): Promise<{ rows?: unknown[] }>;
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export function createPool(config: PoolAttributes): Promise<Pool>;
|
|
18
|
+
}
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Type, type Static } from "@sinclair/typebox";
|
|
2
|
+
import oracledb from "oracledb";
|
|
3
|
+
import type { FastifyInstance } from "fastify";
|
|
4
|
+
import type { FastrackStarter, FastrackContext } from "@fastrack/core";
|
|
5
|
+
import { registerHealthContributor } from "@fastrack/starter-actuator";
|
|
6
|
+
|
|
7
|
+
export const OracleStarterConfigSchema = Type.Object({
|
|
8
|
+
connectionString: Type.String(),
|
|
9
|
+
user: Type.Optional(Type.String()),
|
|
10
|
+
password: Type.Optional(Type.String()),
|
|
11
|
+
poolMin: Type.Optional(Type.Number({ default: 0 })),
|
|
12
|
+
poolMax: Type.Optional(Type.Number({ default: 10 })),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type OracleStarterConfig = Static<typeof OracleStarterConfigSchema>;
|
|
16
|
+
|
|
17
|
+
export interface OracleClient {
|
|
18
|
+
query(sql: string, params?: unknown[]): Promise<unknown[]>;
|
|
19
|
+
transaction<T>(fn: (tx: { query: (sql: string, params?: unknown[]) => Promise<unknown[]> }) => Promise<T>): Promise<T>;
|
|
20
|
+
health(): Promise<{ ok: boolean }>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const oracleStarter: FastrackStarter<OracleStarterConfig> = {
|
|
24
|
+
name: "db-oracle",
|
|
25
|
+
configSchema: OracleStarterConfigSchema,
|
|
26
|
+
defaults: { poolMin: 0, poolMax: 10 },
|
|
27
|
+
register(app: FastifyInstance, ctx: FastrackContext, config: OracleStarterConfig) {
|
|
28
|
+
const poolConfig: oracledb.PoolAttributes = {
|
|
29
|
+
user: config.user,
|
|
30
|
+
password: config.password,
|
|
31
|
+
connectString: config.connectionString,
|
|
32
|
+
poolMin: config.poolMin ?? 0,
|
|
33
|
+
poolMax: config.poolMax ?? 10,
|
|
34
|
+
};
|
|
35
|
+
let pool: oracledb.Pool | null = null;
|
|
36
|
+
async function getPool(): Promise<oracledb.Pool> {
|
|
37
|
+
if (!pool) pool = await oracledb.createPool(poolConfig);
|
|
38
|
+
return pool;
|
|
39
|
+
}
|
|
40
|
+
const client: OracleClient = {
|
|
41
|
+
async query(sqlText: string, params?: unknown[]) {
|
|
42
|
+
const p = await getPool();
|
|
43
|
+
const conn = await p.getConnection();
|
|
44
|
+
try {
|
|
45
|
+
const result = await conn.execute(sqlText, params ?? []);
|
|
46
|
+
return (result.rows ?? []) as unknown[];
|
|
47
|
+
} finally {
|
|
48
|
+
await conn.close();
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
async transaction<T>(fn: (tx: { query: (s: string, p?: unknown[]) => Promise<unknown[]> }) => Promise<T>) {
|
|
52
|
+
const p = await getPool();
|
|
53
|
+
const conn = await p.getConnection();
|
|
54
|
+
try {
|
|
55
|
+
await conn.execute("BEGIN NULL; END;");
|
|
56
|
+
const tx = {
|
|
57
|
+
query: async (sqlText: string, params?: unknown[]) => {
|
|
58
|
+
const result = await conn.execute(sqlText, params ?? []);
|
|
59
|
+
return (result.rows ?? []) as unknown[];
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
const out = await fn(tx);
|
|
63
|
+
return out;
|
|
64
|
+
} finally {
|
|
65
|
+
await conn.close();
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
async health() {
|
|
69
|
+
try {
|
|
70
|
+
const rows = await client.query("SELECT 1 FROM DUAL");
|
|
71
|
+
return { ok: Array.isArray(rows) && rows.length > 0 };
|
|
72
|
+
} catch {
|
|
73
|
+
return { ok: false };
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
app.decorate("oracle", client);
|
|
78
|
+
registerHealthContributor(app, "oracle", () => client.health());
|
|
79
|
+
ctx.onShutdown?.(async () => {
|
|
80
|
+
if (pool) await pool.close(10);
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
};
|