orchid-orm 1.68.3 → 1.68.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/dist/index.d.ts +15 -7
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/dist/migrations/index.js +59 -2
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/index.mjs +59 -2
- package/dist/migrations/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1371,6 +1371,10 @@ function isInTransaction() {
|
|
|
1371
1371
|
function afterCommit(hook) {
|
|
1372
1372
|
this.$qb.afterCommit(hook);
|
|
1373
1373
|
}
|
|
1374
|
+
/**
|
|
1375
|
+
* Identity helper for table row-level security configuration.
|
|
1376
|
+
*/
|
|
1377
|
+
const defineRls = (rls) => rls;
|
|
1374
1378
|
const orchidORMWithAdapter = ({ log, logger, autoPreparedStatements, noPrimaryKey = "error", schema, ...options }, tables) => {
|
|
1375
1379
|
const commonOptions = {
|
|
1376
1380
|
log,
|
|
@@ -1390,6 +1394,7 @@ const orchidORMWithAdapter = ({ log, logger, autoPreparedStatements, noPrimaryKe
|
|
|
1390
1394
|
asyncStorage = new AsyncLocalStorage();
|
|
1391
1395
|
qb = _initQueryBuilder(adapter, makeColumnTypes(defaultSchemaConfig), asyncStorage, commonOptions, options);
|
|
1392
1396
|
}
|
|
1397
|
+
qb.internal.rls = options.rls;
|
|
1393
1398
|
const result = {
|
|
1394
1399
|
$transaction: transaction,
|
|
1395
1400
|
$ensureTransaction: ensureTransaction,
|
|
@@ -1432,6 +1437,7 @@ const orchidORMWithAdapter = ({ log, logger, autoPreparedStatements, noPrimaryKe
|
|
|
1432
1437
|
dbTable.db = result;
|
|
1433
1438
|
dbTable.filePath = table.filePath;
|
|
1434
1439
|
dbTable.name = table.constructor.name;
|
|
1440
|
+
dbTable.internal.tableRls = table.rls;
|
|
1435
1441
|
result[key] = dbTable;
|
|
1436
1442
|
}
|
|
1437
1443
|
applyRelations(qb, tableInstances, result, schema);
|
|
@@ -1474,6 +1480,6 @@ const createRepo = (table, methods) => {
|
|
|
1474
1480
|
return q[key];
|
|
1475
1481
|
} });
|
|
1476
1482
|
};
|
|
1477
|
-
export { createBaseTable, createRepo, orchidORMWithAdapter };
|
|
1483
|
+
export { createBaseTable, createRepo, defineRls, orchidORMWithAdapter };
|
|
1478
1484
|
|
|
1479
1485
|
//# sourceMappingURL=index.mjs.map
|