remult 0.24.0-exp.1 → 0.24.0-exp.2
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.
|
@@ -25,8 +25,10 @@ export class PostgresDataProvider {
|
|
|
25
25
|
constructor(pool, options) {
|
|
26
26
|
this.pool = pool;
|
|
27
27
|
this.options = options;
|
|
28
|
-
if (options
|
|
28
|
+
if (options?.wrapIdentifier)
|
|
29
29
|
this.wrapIdentifier = options.wrapIdentifier;
|
|
30
|
+
if (!options?.wrapIdentifier && options.caseInsensitiveIdentifiers)
|
|
31
|
+
this.wrapIdentifier = (name) => name;
|
|
30
32
|
if (options.schema) {
|
|
31
33
|
this.pool = new PostgresSchemaWrapper(pool, options.schema);
|
|
32
34
|
}
|
|
@@ -124,8 +126,8 @@ export async function createPostgresDataProvider(options) {
|
|
|
124
126
|
config.connectionString = options.connectionString;
|
|
125
127
|
}
|
|
126
128
|
const db = new SqlDatabase(new PostgresDataProvider(new Pool(config), {
|
|
127
|
-
wrapIdentifier: options
|
|
128
|
-
|
|
129
|
+
wrapIdentifier: options.wrapIdentifier,
|
|
130
|
+
caseInsensitiveIdentifiers: options.caseInsensitiveIdentifiers,
|
|
129
131
|
schema: options.schema,
|
|
130
132
|
}));
|
|
131
133
|
let remult = new Remult();
|
package/package.json
CHANGED
|
@@ -19,6 +19,7 @@ export declare class PostgresDataProvider implements SqlImplementation {
|
|
|
19
19
|
createCommand(): SqlCommand;
|
|
20
20
|
constructor(pool: PostgresPool, options?: {
|
|
21
21
|
wrapIdentifier?: (name: string) => string;
|
|
22
|
+
caseInsensitiveIdentifiers?: boolean;
|
|
22
23
|
schema?: string;
|
|
23
24
|
});
|
|
24
25
|
wrapIdentifier: (name: any) => any;
|
|
@@ -20,8 +20,10 @@ var PostgresDataProvider = /** @class */ (function () {
|
|
|
20
20
|
})
|
|
21
21
|
.join('.');
|
|
22
22
|
};
|
|
23
|
-
if (options.wrapIdentifier)
|
|
23
|
+
if (options === null || options === void 0 ? void 0 : options.wrapIdentifier)
|
|
24
24
|
this.wrapIdentifier = options.wrapIdentifier;
|
|
25
|
+
if (!(options === null || options === void 0 ? void 0 : options.wrapIdentifier) && options.caseInsensitiveIdentifiers)
|
|
26
|
+
this.wrapIdentifier = function (name) { return name; };
|
|
25
27
|
if (options.schema) {
|
|
26
28
|
this.pool = new PostgresSchemaWrapper(pool, options.schema);
|
|
27
29
|
}
|
|
@@ -180,8 +182,8 @@ function createPostgresDataProvider(options) {
|
|
|
180
182
|
config.connectionString = options.connectionString;
|
|
181
183
|
}
|
|
182
184
|
db = new sql_database_js_1.SqlDatabase(new PostgresDataProvider(new Pool(config), {
|
|
183
|
-
wrapIdentifier:
|
|
184
|
-
|
|
185
|
+
wrapIdentifier: options.wrapIdentifier,
|
|
186
|
+
caseInsensitiveIdentifiers: options.caseInsensitiveIdentifiers,
|
|
185
187
|
schema: options.schema,
|
|
186
188
|
}));
|
|
187
189
|
remult = new context_js_1.Remult();
|