kysely 0.5.1 → 0.5.5
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/check-esm-imports.js +38 -0
- package/dist/cjs/dialect/postgres/postgres-introspector.d.ts +2 -2
- package/dist/cjs/dialect/postgres/postgres-introspector.js +6 -6
- package/dist/cjs/index.d.ts +9 -9
- package/dist/cjs/introspection/database-introspector.d.ts +1 -1
- package/dist/cjs/parser/on-conflict-parser.d.ts +3 -3
- package/dist/cjs/parser/on-conflict-parser.js +12 -12
- package/dist/cjs/plugin/plugin.d.ts +2 -2
- package/dist/cjs/plugin/with-schema/with-schema-plugin.d.ts +3 -3
- package/dist/cjs/plugin/with-schema/with-schema-plugin.js +2 -2
- package/dist/cjs/query-executor/default-query-executor.d.ts +6 -7
- package/dist/cjs/query-executor/default-query-executor.js +2 -2
- package/dist/cjs/query-executor/never-executing-query-executor.d.ts +3 -3
- package/dist/cjs/query-executor/never-executing-query-executor.js +2 -2
- package/dist/cjs/query-executor/query-executor.d.ts +1 -1
- package/dist/cjs/util/generated-placeholder.d.ts +1 -1
- package/dist/cjs/util/generated-placeholder.js +3 -3
- package/dist/cjs/util/query-id.js +4 -4
- package/dist/esm/dialect/postgres/postgres-introspector.d.ts +2 -2
- package/dist/esm/dialect/postgres/postgres-introspector.js +2 -2
- package/dist/esm/index.d.ts +9 -9
- package/dist/esm/introspection/database-introspector.d.ts +1 -1
- package/dist/esm/parser/on-conflict-parser.d.ts +3 -3
- package/dist/esm/parser/on-conflict-parser.js +5 -5
- package/dist/esm/plugin/plugin.d.ts +2 -2
- package/dist/esm/plugin/with-schema/with-schema-plugin.d.ts +3 -3
- package/dist/esm/plugin/with-schema/with-schema-plugin.js +1 -1
- package/dist/esm/query-executor/default-query-executor.d.ts +6 -7
- package/dist/esm/query-executor/default-query-executor.js +1 -1
- package/dist/esm/query-executor/never-executing-query-executor.d.ts +3 -3
- package/dist/esm/query-executor/never-executing-query-executor.js +1 -1
- package/dist/esm/query-executor/query-executor.d.ts +1 -1
- package/dist/esm/util/generated-placeholder.d.ts +1 -1
- package/dist/esm/util/generated-placeholder.js +1 -1
- package/dist/esm/util/query-id.js +2 -2
- package/package.json +3 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const fs = require('fs')
|
|
2
|
+
const path = require('path')
|
|
3
|
+
|
|
4
|
+
let errorsFound = false
|
|
5
|
+
|
|
6
|
+
function checkFolder(folder) {
|
|
7
|
+
for (const file of fs.readdirSync(folder)) {
|
|
8
|
+
if (file === '.' || file === '..') {
|
|
9
|
+
continue
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const filePath = path.join(folder, file)
|
|
13
|
+
|
|
14
|
+
if (isDir(filePath)) {
|
|
15
|
+
checkFolder(filePath)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (file.endsWith('.ts')) {
|
|
19
|
+
for (const row of fs.readFileSync(filePath).toString().split('\n')) {
|
|
20
|
+
if (row.includes("from '.") && !row.endsWith(".js'")) {
|
|
21
|
+
console.log(`invalid import in file ${filePath}`)
|
|
22
|
+
console.log(row)
|
|
23
|
+
errorsFound = true
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function isDir(file) {
|
|
31
|
+
return fs.lstatSync(file).isDirectory()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
checkFolder(path.join(__dirname, 'src'))
|
|
35
|
+
|
|
36
|
+
if (errorsFound) {
|
|
37
|
+
process.exit(1)
|
|
38
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DatabaseIntrospector, DatabaseMetadata, DatabaseMetadataOptions } from '../../introspection/database-introspector';
|
|
2
|
-
import { Kysely } from '../../kysely';
|
|
1
|
+
import { DatabaseIntrospector, DatabaseMetadata, DatabaseMetadataOptions } from '../../introspection/database-introspector.js';
|
|
2
|
+
import { Kysely } from '../../kysely.js';
|
|
3
3
|
export declare class PostgresIntrospector implements DatabaseIntrospector {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(db: Kysely<any>);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PostgresIntrospector = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const migration_js_1 = require("../../migration/migration.js");
|
|
5
|
+
const object_utils_js_1 = require("../../util/object-utils.js");
|
|
6
6
|
class PostgresIntrospector {
|
|
7
7
|
#db;
|
|
8
8
|
constructor(db) {
|
|
@@ -28,8 +28,8 @@ class PostgresIntrospector {
|
|
|
28
28
|
.castTo();
|
|
29
29
|
if (!options.withInternalKyselyTables) {
|
|
30
30
|
query = query
|
|
31
|
-
.where('t.tablename', '!=',
|
|
32
|
-
.where('t.tablename', '!=',
|
|
31
|
+
.where('t.tablename', '!=', migration_js_1.MIGRATION_TABLE)
|
|
32
|
+
.where('t.tablename', '!=', migration_js_1.MIGRATION_LOCK_TABLE);
|
|
33
33
|
}
|
|
34
34
|
const rawColumns = await query.execute();
|
|
35
35
|
return {
|
|
@@ -40,14 +40,14 @@ class PostgresIntrospector {
|
|
|
40
40
|
return columns.reduce((tables, it) => {
|
|
41
41
|
let table = tables.find((tbl) => tbl.name === it.table && tbl.schema === it.schema);
|
|
42
42
|
if (!table) {
|
|
43
|
-
table =
|
|
43
|
+
table = object_utils_js_1.freeze({
|
|
44
44
|
name: it.table,
|
|
45
45
|
schema: it.schema,
|
|
46
46
|
columns: [],
|
|
47
47
|
});
|
|
48
48
|
tables.push(table);
|
|
49
49
|
}
|
|
50
|
-
table.columns.push(
|
|
50
|
+
table.columns.push(object_utils_js_1.freeze({
|
|
51
51
|
name: it.column,
|
|
52
52
|
dataType: it.type,
|
|
53
53
|
isNullable: !it.not_null,
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -102,12 +102,12 @@ export * from './operation-node/order-by-node.js';
|
|
|
102
102
|
export * from './introspection/database-introspector.js';
|
|
103
103
|
export * from './util/compilable.js';
|
|
104
104
|
export { AnyColumn } from './query-builder/type-utils.js';
|
|
105
|
-
export { SelectExpression, SelectExpressionOrList, } from './parser/select-parser';
|
|
106
|
-
export { ReferenceExpression, ReferenceExpressionOrList, } from './parser/reference-parser';
|
|
107
|
-
export { ValueExpression, ValueExpressionOrList } from './parser/value-parser';
|
|
108
|
-
export { ExistsExpression, FilterOperator } from './parser/filter-parser';
|
|
109
|
-
export { TableExpression } from './parser/table-parser';
|
|
110
|
-
export { JoinReferenceExpression, JoinCallbackExpression, } from './parser/join-parser';
|
|
111
|
-
export { InsertObject } from './parser/insert-values-parser';
|
|
112
|
-
export { MutationObject } from './parser/mutation-parser';
|
|
113
|
-
export { OrderByExpression } from './parser/order-by-parser';
|
|
105
|
+
export { SelectExpression, SelectExpressionOrList, } from './parser/select-parser.js';
|
|
106
|
+
export { ReferenceExpression, ReferenceExpressionOrList, } from './parser/reference-parser.js';
|
|
107
|
+
export { ValueExpression, ValueExpressionOrList } from './parser/value-parser.js';
|
|
108
|
+
export { ExistsExpression, FilterOperator } from './parser/filter-parser.js';
|
|
109
|
+
export { TableExpression } from './parser/table-parser.js';
|
|
110
|
+
export { JoinReferenceExpression, JoinCallbackExpression, } from './parser/join-parser.js';
|
|
111
|
+
export { InsertObject } from './parser/insert-values-parser.js';
|
|
112
|
+
export { MutationObject } from './parser/mutation-parser.js';
|
|
113
|
+
export { OrderByExpression } from './parser/order-by-parser.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OnConflictNode } from '../operation-node/on-conflict-node';
|
|
2
|
-
import { AnyColumn } from '../query-builder/type-utils';
|
|
3
|
-
import { MutationObject } from './mutation-parser';
|
|
1
|
+
import { OnConflictNode } from '../operation-node/on-conflict-node.js';
|
|
2
|
+
import { AnyColumn } from '../query-builder/type-utils.js';
|
|
3
|
+
import { MutationObject } from './mutation-parser.js';
|
|
4
4
|
export declare type OnConflictConstraintTarget = {
|
|
5
5
|
constraint: string;
|
|
6
6
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseOnConflictUpdate = exports.parseOnConflictDoNothing = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
4
|
+
const identifier_node_js_1 = require("../operation-node/identifier-node.js");
|
|
5
|
+
const on_conflict_node_js_1 = require("../operation-node/on-conflict-node.js");
|
|
6
|
+
const object_utils_js_1 = require("../util/object-utils.js");
|
|
7
|
+
const reference_parser_js_1 = require("./reference-parser.js");
|
|
8
|
+
const update_set_parser_js_1 = require("./update-set-parser.js");
|
|
9
9
|
function parseOnConflictDoNothing(target) {
|
|
10
|
-
return
|
|
10
|
+
return on_conflict_node_js_1.OnConflictNode.create({
|
|
11
11
|
...parseConflictTarget(target),
|
|
12
12
|
doNothing: true,
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
exports.parseOnConflictDoNothing = parseOnConflictDoNothing;
|
|
16
16
|
function parseOnConflictUpdate(target, updates) {
|
|
17
|
-
return
|
|
17
|
+
return on_conflict_node_js_1.OnConflictNode.create({
|
|
18
18
|
...parseConflictTarget(target),
|
|
19
|
-
updates:
|
|
19
|
+
updates: update_set_parser_js_1.parseUpdateObject(updates),
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
exports.parseOnConflictUpdate = parseOnConflictUpdate;
|
|
23
23
|
function parseConflictTarget(target) {
|
|
24
|
-
if (
|
|
24
|
+
if (object_utils_js_1.isString(target) || object_utils_js_1.isReadonlyArray(target)) {
|
|
25
25
|
return {
|
|
26
|
-
columns:
|
|
26
|
+
columns: object_utils_js_1.asReadonlyArray(target).map(reference_parser_js_1.parseColumnName),
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
if (
|
|
29
|
+
if (object_utils_js_1.isObject(target) && !object_utils_js_1.isReadonlyArray(target)) {
|
|
30
30
|
return {
|
|
31
|
-
constraint:
|
|
31
|
+
constraint: identifier_node_js_1.IdentifierNode.create(target.constraint),
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
throw new Error(`invalid on conflict target ${JSON.stringify(target)}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Kysely } from '../kysely';
|
|
2
|
-
import { ExecutorPlugin } from '../query-executor/query-executor';
|
|
1
|
+
import { Kysely } from '../kysely.js';
|
|
2
|
+
import { ExecutorPlugin } from '../query-executor/query-executor.js';
|
|
3
3
|
export interface KyselyPlugin extends ExecutorPlugin {
|
|
4
4
|
/**
|
|
5
5
|
* This method is called from {@link Kysely.create} function. The `Kysely` instance
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QueryResult } from '../../driver/database-connection';
|
|
2
|
-
import { RootOperationNode } from '../../query-compiler/query-compiler';
|
|
3
|
-
import { AnyRow, ExecutorPlugin, PluginTransformQueryArgs, PluginTransformResultArgs } from '../../query-executor/query-executor';
|
|
1
|
+
import { QueryResult } from '../../driver/database-connection.js';
|
|
2
|
+
import { RootOperationNode } from '../../query-compiler/query-compiler.js';
|
|
3
|
+
import { AnyRow, ExecutorPlugin, PluginTransformQueryArgs, PluginTransformResultArgs } from '../../query-executor/query-executor.js';
|
|
4
4
|
export declare class WithSchemaPlugin implements ExecutorPlugin {
|
|
5
5
|
#private;
|
|
6
6
|
constructor(schema: string);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WithSchemaPlugin = void 0;
|
|
4
|
-
const
|
|
4
|
+
const with_schema_transformer_js_1 = require("../../transformers/with-schema-transformer.js");
|
|
5
5
|
class WithSchemaPlugin {
|
|
6
6
|
#transformer;
|
|
7
7
|
constructor(schema) {
|
|
8
|
-
this.#transformer = new
|
|
8
|
+
this.#transformer = new with_schema_transformer_js_1.WithSchemaTransformer(schema);
|
|
9
9
|
}
|
|
10
10
|
transformQuery(args) {
|
|
11
11
|
return this.#transformer.transformNode(args.node);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { QueryExecutor } from './query-executor';
|
|
1
|
+
import { ConnectionProvider } from '../driver/connection-provider.js';
|
|
2
|
+
import { QueryResult } from '../driver/database-connection.js';
|
|
3
|
+
import { CompiledQuery } from '../query-compiler/compiled-query.js';
|
|
4
|
+
import { RootOperationNode, QueryCompiler } from '../query-compiler/query-compiler.js';
|
|
5
|
+
import { QueryId } from '../util/query-id.js';
|
|
6
|
+
import { ExecutorPlugin, QueryExecutor } from './query-executor.js';
|
|
8
7
|
export declare class DefaultQueryExecutor extends QueryExecutor {
|
|
9
8
|
#private;
|
|
10
9
|
constructor(compiler: QueryCompiler, connectionProvider: ConnectionProvider, plugins?: ExecutorPlugin[]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DefaultQueryExecutor = void 0;
|
|
4
|
-
const
|
|
5
|
-
class DefaultQueryExecutor extends
|
|
4
|
+
const query_executor_js_1 = require("./query-executor.js");
|
|
5
|
+
class DefaultQueryExecutor extends query_executor_js_1.QueryExecutor {
|
|
6
6
|
#compiler;
|
|
7
7
|
#connectionProvider;
|
|
8
8
|
constructor(compiler, connectionProvider, plugins = []) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QueryResult } from '../driver/database-connection';
|
|
2
|
-
import { CompiledQuery } from '../query-compiler/compiled-query';
|
|
3
|
-
import { ExecutorPlugin, QueryExecutor } from './query-executor';
|
|
1
|
+
import { QueryResult } from '../driver/database-connection.js';
|
|
2
|
+
import { CompiledQuery } from '../query-compiler/compiled-query.js';
|
|
3
|
+
import { ExecutorPlugin, QueryExecutor } from './query-executor.js';
|
|
4
4
|
export declare class NeverExecutingQueryExecutor extends QueryExecutor {
|
|
5
5
|
compileQuery(): CompiledQuery;
|
|
6
6
|
executeQuery<R>(): Promise<QueryResult<R>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NeverExecutingQueryExecutor = void 0;
|
|
4
|
-
const
|
|
5
|
-
class NeverExecutingQueryExecutor extends
|
|
4
|
+
const query_executor_js_1 = require("./query-executor.js");
|
|
5
|
+
class NeverExecutingQueryExecutor extends query_executor_js_1.QueryExecutor {
|
|
6
6
|
compileQuery() {
|
|
7
7
|
throw new Error('this query cannot be compiled to SQL');
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConnectionProvider } from '../driver/connection-provider.js';
|
|
2
2
|
import { QueryResult } from '../driver/database-connection.js';
|
|
3
3
|
import { CompiledQuery } from '../query-compiler/compiled-query.js';
|
|
4
|
-
import { RootOperationNode } from '../query-compiler/query-compiler';
|
|
4
|
+
import { RootOperationNode } from '../query-compiler/query-compiler.js';
|
|
5
5
|
import { QueryId } from '../util/query-id.js';
|
|
6
6
|
export declare abstract class QueryExecutor {
|
|
7
7
|
#private;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GeneratedPlaceholder } from '../query-builder/type-utils';
|
|
1
|
+
import { GeneratedPlaceholder } from '../query-builder/type-utils.js';
|
|
2
2
|
export declare const generatedPlaceholder: GeneratedPlaceholder;
|
|
3
3
|
export declare function isGeneratedPlaceholder(obj: unknown): obj is GeneratedPlaceholder;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isGeneratedPlaceholder = exports.generatedPlaceholder = void 0;
|
|
4
|
-
const
|
|
5
|
-
exports.generatedPlaceholder =
|
|
4
|
+
const object_utils_js_1 = require("./object-utils.js");
|
|
5
|
+
exports.generatedPlaceholder = object_utils_js_1.freeze({
|
|
6
6
|
__isGeneratedPlaceholder__: true,
|
|
7
7
|
});
|
|
8
8
|
function isGeneratedPlaceholder(obj) {
|
|
9
|
-
return
|
|
9
|
+
return object_utils_js_1.isObject(obj) && obj.__isGeneratedPlaceholder__ === true;
|
|
10
10
|
}
|
|
11
11
|
exports.isGeneratedPlaceholder = isGeneratedPlaceholder;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createQueryId = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const object_utils_js_1 = require("./object-utils.js");
|
|
5
|
+
const random_string_js_1 = require("./random-string.js");
|
|
6
6
|
function createQueryId() {
|
|
7
|
-
return
|
|
8
|
-
queryId:
|
|
7
|
+
return object_utils_js_1.freeze({
|
|
8
|
+
queryId: random_string_js_1.randomString(8),
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
exports.createQueryId = createQueryId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DatabaseIntrospector, DatabaseMetadata, DatabaseMetadataOptions } from '../../introspection/database-introspector';
|
|
2
|
-
import { Kysely } from '../../kysely';
|
|
1
|
+
import { DatabaseIntrospector, DatabaseMetadata, DatabaseMetadataOptions } from '../../introspection/database-introspector.js';
|
|
2
|
+
import { Kysely } from '../../kysely.js';
|
|
3
3
|
export declare class PostgresIntrospector implements DatabaseIntrospector {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(db: Kysely<any>);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MIGRATION_LOCK_TABLE, MIGRATION_TABLE, } from '../../migration/migration';
|
|
2
|
-
import { freeze } from '../../util/object-utils';
|
|
1
|
+
import { MIGRATION_LOCK_TABLE, MIGRATION_TABLE, } from '../../migration/migration.js';
|
|
2
|
+
import { freeze } from '../../util/object-utils.js';
|
|
3
3
|
export class PostgresIntrospector {
|
|
4
4
|
#db;
|
|
5
5
|
constructor(db) {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -102,12 +102,12 @@ export * from './operation-node/order-by-node.js';
|
|
|
102
102
|
export * from './introspection/database-introspector.js';
|
|
103
103
|
export * from './util/compilable.js';
|
|
104
104
|
export { AnyColumn } from './query-builder/type-utils.js';
|
|
105
|
-
export { SelectExpression, SelectExpressionOrList, } from './parser/select-parser';
|
|
106
|
-
export { ReferenceExpression, ReferenceExpressionOrList, } from './parser/reference-parser';
|
|
107
|
-
export { ValueExpression, ValueExpressionOrList } from './parser/value-parser';
|
|
108
|
-
export { ExistsExpression, FilterOperator } from './parser/filter-parser';
|
|
109
|
-
export { TableExpression } from './parser/table-parser';
|
|
110
|
-
export { JoinReferenceExpression, JoinCallbackExpression, } from './parser/join-parser';
|
|
111
|
-
export { InsertObject } from './parser/insert-values-parser';
|
|
112
|
-
export { MutationObject } from './parser/mutation-parser';
|
|
113
|
-
export { OrderByExpression } from './parser/order-by-parser';
|
|
105
|
+
export { SelectExpression, SelectExpressionOrList, } from './parser/select-parser.js';
|
|
106
|
+
export { ReferenceExpression, ReferenceExpressionOrList, } from './parser/reference-parser.js';
|
|
107
|
+
export { ValueExpression, ValueExpressionOrList } from './parser/value-parser.js';
|
|
108
|
+
export { ExistsExpression, FilterOperator } from './parser/filter-parser.js';
|
|
109
|
+
export { TableExpression } from './parser/table-parser.js';
|
|
110
|
+
export { JoinReferenceExpression, JoinCallbackExpression, } from './parser/join-parser.js';
|
|
111
|
+
export { InsertObject } from './parser/insert-values-parser.js';
|
|
112
|
+
export { MutationObject } from './parser/mutation-parser.js';
|
|
113
|
+
export { OrderByExpression } from './parser/order-by-parser.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OnConflictNode } from '../operation-node/on-conflict-node';
|
|
2
|
-
import { AnyColumn } from '../query-builder/type-utils';
|
|
3
|
-
import { MutationObject } from './mutation-parser';
|
|
1
|
+
import { OnConflictNode } from '../operation-node/on-conflict-node.js';
|
|
2
|
+
import { AnyColumn } from '../query-builder/type-utils.js';
|
|
3
|
+
import { MutationObject } from './mutation-parser.js';
|
|
4
4
|
export declare type OnConflictConstraintTarget = {
|
|
5
5
|
constraint: string;
|
|
6
6
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IdentifierNode } from '../operation-node/identifier-node';
|
|
2
|
-
import { OnConflictNode } from '../operation-node/on-conflict-node';
|
|
3
|
-
import { asReadonlyArray, isObject, isReadonlyArray, isString, } from '../util/object-utils';
|
|
4
|
-
import { parseColumnName } from './reference-parser';
|
|
5
|
-
import { parseUpdateObject } from './update-set-parser';
|
|
1
|
+
import { IdentifierNode } from '../operation-node/identifier-node.js';
|
|
2
|
+
import { OnConflictNode } from '../operation-node/on-conflict-node.js';
|
|
3
|
+
import { asReadonlyArray, isObject, isReadonlyArray, isString, } from '../util/object-utils.js';
|
|
4
|
+
import { parseColumnName } from './reference-parser.js';
|
|
5
|
+
import { parseUpdateObject } from './update-set-parser.js';
|
|
6
6
|
export function parseOnConflictDoNothing(target) {
|
|
7
7
|
return OnConflictNode.create({
|
|
8
8
|
...parseConflictTarget(target),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Kysely } from '../kysely';
|
|
2
|
-
import { ExecutorPlugin } from '../query-executor/query-executor';
|
|
1
|
+
import { Kysely } from '../kysely.js';
|
|
2
|
+
import { ExecutorPlugin } from '../query-executor/query-executor.js';
|
|
3
3
|
export interface KyselyPlugin extends ExecutorPlugin {
|
|
4
4
|
/**
|
|
5
5
|
* This method is called from {@link Kysely.create} function. The `Kysely` instance
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QueryResult } from '../../driver/database-connection';
|
|
2
|
-
import { RootOperationNode } from '../../query-compiler/query-compiler';
|
|
3
|
-
import { AnyRow, ExecutorPlugin, PluginTransformQueryArgs, PluginTransformResultArgs } from '../../query-executor/query-executor';
|
|
1
|
+
import { QueryResult } from '../../driver/database-connection.js';
|
|
2
|
+
import { RootOperationNode } from '../../query-compiler/query-compiler.js';
|
|
3
|
+
import { AnyRow, ExecutorPlugin, PluginTransformQueryArgs, PluginTransformResultArgs } from '../../query-executor/query-executor.js';
|
|
4
4
|
export declare class WithSchemaPlugin implements ExecutorPlugin {
|
|
5
5
|
#private;
|
|
6
6
|
constructor(schema: string);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { QueryExecutor } from './query-executor';
|
|
1
|
+
import { ConnectionProvider } from '../driver/connection-provider.js';
|
|
2
|
+
import { QueryResult } from '../driver/database-connection.js';
|
|
3
|
+
import { CompiledQuery } from '../query-compiler/compiled-query.js';
|
|
4
|
+
import { RootOperationNode, QueryCompiler } from '../query-compiler/query-compiler.js';
|
|
5
|
+
import { QueryId } from '../util/query-id.js';
|
|
6
|
+
import { ExecutorPlugin, QueryExecutor } from './query-executor.js';
|
|
8
7
|
export declare class DefaultQueryExecutor extends QueryExecutor {
|
|
9
8
|
#private;
|
|
10
9
|
constructor(compiler: QueryCompiler, connectionProvider: ConnectionProvider, plugins?: ExecutorPlugin[]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QueryResult } from '../driver/database-connection';
|
|
2
|
-
import { CompiledQuery } from '../query-compiler/compiled-query';
|
|
3
|
-
import { ExecutorPlugin, QueryExecutor } from './query-executor';
|
|
1
|
+
import { QueryResult } from '../driver/database-connection.js';
|
|
2
|
+
import { CompiledQuery } from '../query-compiler/compiled-query.js';
|
|
3
|
+
import { ExecutorPlugin, QueryExecutor } from './query-executor.js';
|
|
4
4
|
export declare class NeverExecutingQueryExecutor extends QueryExecutor {
|
|
5
5
|
compileQuery(): CompiledQuery;
|
|
6
6
|
executeQuery<R>(): Promise<QueryResult<R>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConnectionProvider } from '../driver/connection-provider.js';
|
|
2
2
|
import { QueryResult } from '../driver/database-connection.js';
|
|
3
3
|
import { CompiledQuery } from '../query-compiler/compiled-query.js';
|
|
4
|
-
import { RootOperationNode } from '../query-compiler/query-compiler';
|
|
4
|
+
import { RootOperationNode } from '../query-compiler/query-compiler.js';
|
|
5
5
|
import { QueryId } from '../util/query-id.js';
|
|
6
6
|
export declare abstract class QueryExecutor {
|
|
7
7
|
#private;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GeneratedPlaceholder } from '../query-builder/type-utils';
|
|
1
|
+
import { GeneratedPlaceholder } from '../query-builder/type-utils.js';
|
|
2
2
|
export declare const generatedPlaceholder: GeneratedPlaceholder;
|
|
3
3
|
export declare function isGeneratedPlaceholder(obj: unknown): obj is GeneratedPlaceholder;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { freeze } from './object-utils';
|
|
2
|
-
import { randomString } from './random-string';
|
|
1
|
+
import { freeze } from './object-utils.js';
|
|
2
|
+
import { randomString } from './random-string.js';
|
|
3
3
|
export function createQueryId() {
|
|
4
4
|
return freeze({
|
|
5
5
|
queryId: randomString(8),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kysely",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "Type safe SQL query builder",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"test:build": "rm -rf test/lib && tsc -p test",
|
|
19
19
|
"clean": "rm -rf dist && rm -rf test/dist",
|
|
20
|
-
"test": "npm run clean && npm run build:cjs && npm run test:build && npm run test:integration && npm run test:typings",
|
|
20
|
+
"test": "npm run clean && npm run build:cjs && npm run test:build && npm run test:integration && npm run test:typings && npm run test:esmimports",
|
|
21
21
|
"test:integration": "mocha --timeout 5000 test/dist/**/*.test.js",
|
|
22
22
|
"test:typings": "tsd test/typings",
|
|
23
|
+
"test:esmimports": "node check-esm-imports.js",
|
|
23
24
|
"prettier": "prettier --write src/**/*.ts test/**/*.ts",
|
|
24
25
|
"build": "npm run clean && npm run build:esm && npm run build:cjs && ./module-fixup.sh",
|
|
25
26
|
"build:esm": "tsc -p tsconfig.json",
|