rado 0.1.10 → 0.1.11

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/Fields.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import { Column } from './Column';
2
2
  import { Expr } from './Expr';
3
- type RecordField<T> = Expr<T> & FieldsOf<T>;
3
+ type GetKeys<U> = U extends Record<infer K, any> ? K : never;
4
+ type UnionToIntersection<U> = {
5
+ [K in GetKeys<U>]: U extends Record<K, infer T> ? T : never;
6
+ };
7
+ type RecordField<T> = Expr<T> & FieldsOf<UnionToIntersection<T>>;
4
8
  type Field<T> = [T] extends [Array<any>] ? Expr<T> : [T] extends [Column.Primary<infer K, infer V>] ? Expr<string extends K ? V : V & {
5
9
  [Column.isPrimary]: K;
6
10
  }> : [T] extends [Column.Optional<infer V>] ? Field<V> : [T] extends [number | string | boolean] ? Expr<T> : [T] extends [Record<string, any> | null] ? RecordField<T> : Expr<T>;
package/dist/Table.js CHANGED
@@ -87,9 +87,14 @@ function table(options) {
87
87
  new Expr(ExprData.Row(Target.Table(schema)))
88
88
  ) : {}
89
89
  ).map(([key, index]) => {
90
+ const indexName = `${schema.name}.${key}`;
90
91
  return [
91
- key,
92
- { name: key, on: index.on.map(ExprData.create), where: index.where?.expr }
92
+ indexName,
93
+ {
94
+ name: indexName,
95
+ on: index.on.map(ExprData.create),
96
+ where: index.where?.expr
97
+ }
93
98
  ];
94
99
  })
95
100
  );
@@ -0,0 +1,2 @@
1
+ export * from './sqlite/SqliteFormatter';
2
+ export * from './sqlite/SqliteFunctions';
package/dist/sqlite.js ADDED
@@ -0,0 +1,3 @@
1
+ // src/sqlite.ts
2
+ export * from "./sqlite/SqliteFormatter.js";
3
+ export * from "./sqlite/SqliteFunctions.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rado",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,2 +0,0 @@
1
- export * from './SqliteFormatter';
2
- export * from './SqliteFunctions';
@@ -1,3 +0,0 @@
1
- // src/sqlite/index.ts
2
- export * from "./SqliteFormatter.js";
3
- export * from "./SqliteFunctions.js";