orchid-orm 1.5.19 → 1.5.20
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 +6 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/codegen/appCodeUpdater.test.ts +10 -5
- package/src/codegen/appCodeUpdater.ts +14 -7
- 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: (config: AppCodeUpdaterConfig) => AppCodeUpdater;
|
|
438
|
+
declare const appCodeUpdater: (config: 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
|
@@ -2342,11 +2342,15 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
2342
2342
|
class AppCodeUpdaterError extends Error {
|
|
2343
2343
|
}
|
|
2344
2344
|
const appCodeUpdater = (config) => {
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2345
|
+
return async ({ ast, options, basePath, cache: cacheObject }) => {
|
|
2346
|
+
const params = __spreadProps(__spreadValues({}, config), {
|
|
2347
|
+
baseTableName: config.baseTableName || "BaseTable",
|
|
2348
|
+
tablePath(name) {
|
|
2349
|
+
const file = config.tablePath(name);
|
|
2350
|
+
return path__namespace.isAbsolute(file) ? file : path__namespace.resolve(basePath, file);
|
|
2351
|
+
},
|
|
2352
|
+
mainFilePath: path__namespace.isAbsolute(config.mainFilePath) ? config.mainFilePath : path__namespace.resolve(basePath, config.mainFilePath)
|
|
2353
|
+
});
|
|
2350
2354
|
const promises = [
|
|
2351
2355
|
updateMainFile(params.mainFilePath, params.tablePath, ast, options),
|
|
2352
2356
|
updateTableFile(__spreadProps(__spreadValues({}, params), { ast }))
|