orchid-orm 1.5.19 → 1.5.21
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/.turbo/turbo-test.log +26 -0
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/codegen/appCodeUpdater.test.ts +17 -8
- package/src/codegen/appCodeUpdater.ts +20 -9
- package/src/orm.test.ts +12 -4
- package/src/transaction.test.ts +2 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
> orchid-orm@1.5.19 test /home/romeo/dev/my/orchid-orm/packages/orm
|
|
3
|
+
> jest "--coverage" "--coverageReporters" "json-summary"
|
|
4
|
+
|
|
5
|
+
PASS src/relations/hasAndBelongsToMany.test.ts
|
|
6
|
+
PASS src/codegen/updateTableFile/renameTable.test.ts (5.657 s)
|
|
7
|
+
PASS src/codegen/updateTableFile/createTable.test.ts (5.458 s)
|
|
8
|
+
PASS src/codegen/updateMainFile.test.ts (5.801 s)
|
|
9
|
+
PASS src/relations/belongsTo.test.ts (5.811 s)
|
|
10
|
+
PASS src/codegen/updateTableFile/changeTable.test.ts (6.179 s)
|
|
11
|
+
PASS src/relations/hasMany.test.ts (6.685 s)
|
|
12
|
+
PASS src/bin/init.test.ts
|
|
13
|
+
PASS src/repo.test.ts
|
|
14
|
+
PASS src/relations/hasOne.test.ts
|
|
15
|
+
PASS src/codegen/createBaseTableFile.test.ts
|
|
16
|
+
PASS src/relations/relations.test.ts
|
|
17
|
+
PASS src/codegen/appCodeUpdater.test.ts
|
|
18
|
+
PASS src/orm.test.ts
|
|
19
|
+
PASS src/transaction.test.ts
|
|
20
|
+
PASS src/table.test.ts
|
|
21
|
+
|
|
22
|
+
Test Suites: 16 passed, 16 total
|
|
23
|
+
Tests: 318 passed, 318 total
|
|
24
|
+
Snapshots: 0 total
|
|
25
|
+
Time: 10.094 s, estimated 12 s
|
|
26
|
+
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as pqb from 'pqb';
|
|
2
|
-
import { BelongsToRelation, HasManyRelation, HasOneRelation, Db, Adapter, AdapterOptions, QueryLogOptions, NoPrimaryKeyOption, HasAndBelongsToManyRelation, Query, defaultsKey, EmptyObject, BaseRelation, RelationQuery, SetQueryReturnsOne, SetQueryReturnsOneOptional, SetQueryReturnsAll, ColumnTypesBase, DefaultColumnTypes, ColumnsShape, ColumnShapeOutput, WhereResult, MergeQuery, SetQueryReturns, QueryReturnType } from 'pqb';
|
|
2
|
+
import { BelongsToRelation, HasManyRelation, HasOneRelation, Db, Adapter, AdapterOptions, QueryLogOptions, NoPrimaryKeyOption, HasAndBelongsToManyRelation, Query, defaultsKey, EmptyObject, BaseRelation, RelationQuery, SetQueryReturnsOne, SetQueryReturnsOneOptional, SetQueryReturnsAll, ColumnTypesBase, DefaultColumnTypes, ColumnsShape, ColumnShapeOutput, WhereResult, MergeQuery, SetQueryReturns, QueryReturnType, SetOptional } from 'pqb';
|
|
3
3
|
export { columnTypes } from 'pqb';
|
|
4
4
|
import { AppCodeUpdater } from 'rake-db';
|
|
5
5
|
|
|
@@ -435,6 +435,6 @@ declare type AppCodeUpdaterConfig = {
|
|
|
435
435
|
baseTableName: string;
|
|
436
436
|
mainFilePath: string;
|
|
437
437
|
};
|
|
438
|
-
declare const appCodeUpdater: (
|
|
438
|
+
declare const appCodeUpdater: ({ tablePath, baseTablePath, baseTableName, mainFilePath, }: SetOptional<AppCodeUpdaterConfig, 'baseTableName'>) => AppCodeUpdater;
|
|
439
439
|
|
|
440
440
|
export { AppCodeUpdaterConfig, AppCodeUpdaterError, DbTable, MapMethods, MapQueryMethods, MethodsBase, OrchidORM, QueryMethods, Repo, Table, TableClass, TableClasses, TableToDb, appCodeUpdater, createBaseTable, createRepo, orchidORM };
|
package/dist/index.js
CHANGED
|
@@ -2341,12 +2341,22 @@ var __spreadValues = (a, b) => {
|
|
|
2341
2341
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
2342
2342
|
class AppCodeUpdaterError extends Error {
|
|
2343
2343
|
}
|
|
2344
|
-
const appCodeUpdater = (
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2344
|
+
const appCodeUpdater = ({
|
|
2345
|
+
tablePath,
|
|
2346
|
+
baseTablePath,
|
|
2347
|
+
baseTableName,
|
|
2348
|
+
mainFilePath
|
|
2349
|
+
}) => {
|
|
2350
|
+
return async ({ ast, options, basePath, cache: cacheObject }) => {
|
|
2351
|
+
const params = {
|
|
2352
|
+
tablePath(name) {
|
|
2353
|
+
const file = tablePath(name);
|
|
2354
|
+
return resolvePath(basePath, file);
|
|
2355
|
+
},
|
|
2356
|
+
baseTablePath: resolvePath(basePath, baseTablePath),
|
|
2357
|
+
baseTableName: baseTableName || "BaseTable",
|
|
2358
|
+
mainFilePath: resolvePath(basePath, mainFilePath)
|
|
2359
|
+
};
|
|
2350
2360
|
const promises = [
|
|
2351
2361
|
updateMainFile(params.mainFilePath, params.tablePath, ast, options),
|
|
2352
2362
|
updateTableFile(__spreadProps(__spreadValues({}, params), { ast }))
|
|
@@ -2362,6 +2372,7 @@ const appCodeUpdater = (config) => {
|
|
|
2362
2372
|
await Promise.all(promises);
|
|
2363
2373
|
};
|
|
2364
2374
|
};
|
|
2375
|
+
const resolvePath = (basePath, filePath) => path__namespace.isAbsolute(filePath) ? filePath : path__namespace.resolve(basePath, filePath);
|
|
2365
2376
|
|
|
2366
2377
|
Object.defineProperty(exports, 'columnTypes', {
|
|
2367
2378
|
enumerable: true,
|