@tstdl/base 0.92.97 → 0.92.99
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.
|
@@ -35,8 +35,9 @@ export function _getDrizzleTableFromType(type, fallbackSchemaName) {
|
|
|
35
35
|
tableReflectionDatas.push(tableReflectionData);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
const mergedTableReflectionData = tableReflectionDatas.reduceRight((merged, data) => ({ ...merged, ...data }), {});
|
|
38
39
|
const tableReflectionData = tableReflectionDatas[0];
|
|
39
|
-
const schema = assertDefinedPass(
|
|
40
|
+
const schema = assertDefinedPass(mergedTableReflectionData.schema ?? fallbackSchemaName, 'Table schema not provided');
|
|
40
41
|
const tableName = tableReflectionData?.name ?? getDefaultTableName(type);
|
|
41
42
|
const dbSchema = getDbSchema(schema);
|
|
42
43
|
const columnDefinitions = getPostgresColumnEntries(type, dbSchema, tableName);
|
|
@@ -64,7 +65,7 @@ export function _getDrizzleTableFromType(type, fallbackSchemaName) {
|
|
|
64
65
|
function buildPrimaryKey(table) {
|
|
65
66
|
const columns = primaryKeyColumnDefinitions.map((columnDefinition) => getColumn(table, columnDefinition.name));
|
|
66
67
|
return primaryKey({
|
|
67
|
-
name:
|
|
68
|
+
name: mergedTableReflectionData.compundPrimaryKeyName ?? getPrimaryKeyName(tableName, columns, { naming: mergedTableReflectionData.compundPrimaryKeyNaming }),
|
|
68
69
|
columns
|
|
69
70
|
});
|
|
70
71
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.92.
|
|
3
|
+
"version": "0.92.99",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"playwright": "^1.51",
|
|
178
178
|
"preact": "^10.26",
|
|
179
179
|
"preact-render-to-string": "^6.5",
|
|
180
|
-
"undici": "^7.
|
|
180
|
+
"undici": "^7.5",
|
|
181
181
|
"urlpattern-polyfill": "^10.0"
|
|
182
182
|
},
|
|
183
183
|
"peerDependenciesMeta": {
|
|
@@ -77,7 +77,7 @@ export class ServerSentEvents {
|
|
|
77
77
|
constructor(url, options) {
|
|
78
78
|
this.eventSource = new EventSource(url, options);
|
|
79
79
|
this.closeSubject = new ReplaySubject(1);
|
|
80
|
-
const open$ = fromEvent(this.eventSource, 'open')
|
|
80
|
+
const open$ = fromEvent(this.eventSource, 'open');
|
|
81
81
|
this.close$ = this.closeSubject.asObservable();
|
|
82
82
|
this.error$ = fromEvent(this.eventSource, 'error').pipe(takeUntil(this.close$), share());
|
|
83
83
|
this.state$ = merge(open$, this.error$, this.close$).pipe(startWith(undefined), map(() => this.state), distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: true }));
|