rads-db 3.2.0 → 3.2.2

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/config.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { g as RadsConfig, T as TypeDefinition } from './types-dd50fa7e.js';
1
+ import { g as RadsConfig, T as TypeDefinition } from './types-9a0ba02b.js';
2
+ import 'mssql';
2
3
  import '_rads-db';
3
4
 
4
5
  declare function defineRadsConfig(config: RadsConfig): RadsConfig;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { E as EntityDecoratorArgs, U as UiDecoratorArgs, a as UiFieldDecoratorArgs, V as ValidateEntityDecoratorArgs, b as ValidateFieldDecoratorArgs, F as FieldDecoratorArgs, C as ComputedDecoratorArgs, S as Schema, D as DriverConstructor, c as Driver, d as ComputedContext, R as RadsRequestContext, e as CreateRadsDbArgs, f as CreateRadsDbClientArgs } from './types-dd50fa7e.js';
2
- export { N as Change, x as ComputedContextGlobal, k as CreateRadsArgsDrivers, m as CreateRadsDbArgsNormalized, aj as DeepKeys, ae as DeepPartial, ac as DeepPartialWithNulls, ad as DeepPartialWithNullsItem, ak as EntityMethods, w as EnumDefinition, v as FieldDefinition, I as FileSystemNode, u as FileUploadArgs, q as FileUploadDriver, p as FileUploadResult, B as GenerateClientNormalizedOptions, A as GenerateClientOptions, a8 as Get, _ as GetAggArgs, $ as GetAggArgsAgg, a2 as GetAggArgsAny, a5 as GetAggResponse, Z as GetArgs, a1 as GetArgsAny, a4 as GetArgsInclude, O as GetManyArgs, a0 as GetManyArgsAny, a6 as GetManyResponse, a7 as GetResponse, a9 as GetResponseInclude, aa as GetResponseIncludeSelect, ab as GetResponseNoInclude, s as GetRestRoutesArgs, G as GetRestRoutesOptions, t as GetRestRoutesResponse, ag as InverseRelation, M as MinimalDriver, ai as Put, ah as PutArgs, P as PutEffect, g as RadsConfig, h as RadsConfigDataSource, r as RadsDbInstance, L as RadsFeature, y as RadsHookDoc, K as RadsUiSlotDefinition, J as RadsUiSlotName, H as RadsVitePluginOptions, af as Relation, i as RequiredFields, l as RestDriverOptions, z as RestFileUploadDriverOptions, n as SchemaLoadResult, o as SchemaValidators, T as TypeDefinition, j as ValidateStringDecoratorArgs, Q as VerifyManyArgs, a3 as VerifyManyArgsAny, X as VerifyManyResponse, Y as Where, W as WhereJsonContains } from './types-dd50fa7e.js';
1
+ import { E as EntityDecoratorArgs, U as UiDecoratorArgs, a as UiFieldDecoratorArgs, V as ValidateEntityDecoratorArgs, b as ValidateFieldDecoratorArgs, F as FieldDecoratorArgs, C as ComputedDecoratorArgs, S as Schema, D as DriverConstructor, c as Driver, d as ComputedContext, R as RadsRequestContext, e as CreateRadsDbArgs, f as CreateRadsDbClientArgs } from './types-9a0ba02b.js';
2
+ export { O as Change, x as ComputedContextGlobal, k as CreateRadsArgsDrivers, m as CreateRadsDbArgsNormalized, ak as DeepKeys, af as DeepPartial, ad as DeepPartialWithNulls, ae as DeepPartialWithNullsItem, al as EntityMethods, w as EnumDefinition, v as FieldDefinition, J as FileSystemNode, u as FileUploadArgs, q as FileUploadDriver, p as FileUploadResult, H as GenerateClientNormalizedOptions, B as GenerateClientOptions, a9 as Get, $ as GetAggArgs, a0 as GetAggArgsAgg, a3 as GetAggArgsAny, a6 as GetAggResponse, _ as GetArgs, a2 as GetArgsAny, a5 as GetArgsInclude, Q as GetManyArgs, a1 as GetManyArgsAny, a7 as GetManyResponse, a8 as GetResponse, aa as GetResponseInclude, ab as GetResponseIncludeSelect, ac as GetResponseNoInclude, s as GetRestRoutesArgs, G as GetRestRoutesOptions, t as GetRestRoutesResponse, ah as InverseRelation, M as MinimalDriver, aj as Put, ai as PutArgs, P as PutEffect, g as RadsConfig, h as RadsConfigDataSource, r as RadsDbInstance, N as RadsFeature, y as RadsHookDoc, L as RadsUiSlotDefinition, K as RadsUiSlotName, I as RadsVitePluginOptions, ag as Relation, i as RequiredFields, l as RestDriverOptions, A as RestFileUploadDriverOptions, n as SchemaLoadResult, o as SchemaValidators, z as SqlDriverOptions, T as TypeDefinition, j as ValidateStringDecoratorArgs, X as VerifyManyArgs, a4 as VerifyManyArgsAny, Y as VerifyManyResponse, Z as Where, W as WhereJsonContains } from './types-9a0ba02b.js';
3
3
  import { RadsDb } from '_rads-db';
4
4
  export { RadsDb } from '_rads-db';
5
+ import 'mssql';
5
6
 
6
7
  declare function entity<T>(meta?: EntityDecoratorArgs): (classConstructor: new () => T, _ctx?: ClassDecoratorContext<any>) => void;
7
8
  declare function ui<T>(args: T extends new () => any ? UiDecoratorArgs<InstanceType<T>> : UiFieldDecoratorArgs): (classConstructor: T, _ctx?: ClassDecoratorContext | ClassFieldDecoratorContext) => void;
@@ -1,3 +1,4 @@
1
+ import { config } from 'mssql';
1
2
  import { EntityMeta, RadsDb } from '_rads-db';
2
3
 
3
4
  type MaybePromise$1<T> = Promise<T> | T;
@@ -373,6 +374,14 @@ interface PutEffect {
373
374
  beforePut?: (computedContext: ComputedContext, docs: RadsHookDoc[], ctx: RadsRequestContext) => MaybePromise<any>;
374
375
  afterPut: (computedContext: ComputedContext, docs: RadsHookDoc[], beforePutResult: any, ctx: RadsRequestContext) => MaybePromise<any>;
375
376
  }
377
+ interface SqlDriverOptions {
378
+ authentication: config['authentication'];
379
+ server: config['server'];
380
+ database: config['database'];
381
+ options?: Omit<config, 'authentication' | 'server' | 'database'>;
382
+ tablePrefix?: string;
383
+ stagingTablePrefix?: string;
384
+ }
376
385
  interface RestFileUploadDriverOptions {
377
386
  /** @default '/api' */
378
387
  baseUrl?: string;
@@ -458,4 +467,4 @@ interface RadsFeature {
458
467
  afterUploadFile?: (result: FileUploadResult, args: FileUploadArgs) => MaybePromise<void>;
459
468
  }
460
469
 
461
- export { GetAggArgsAgg as $, GenerateClientOptions as A, GenerateClientNormalizedOptions as B, ComputedDecoratorArgs as C, DriverConstructor as D, EntityDecoratorArgs as E, FieldDecoratorArgs as F, GetRestRoutesOptions as G, RadsVitePluginOptions as H, FileSystemNode as I, RadsUiSlotName as J, RadsUiSlotDefinition as K, RadsFeature as L, MinimalDriver as M, Change as N, GetManyArgs as O, PutEffect as P, VerifyManyArgs as Q, RadsRequestContext as R, Schema as S, TypeDefinition as T, UiDecoratorArgs as U, ValidateEntityDecoratorArgs as V, WhereJsonContains as W, VerifyManyResponse as X, Where as Y, GetArgs as Z, GetAggArgs as _, UiFieldDecoratorArgs as a, GetManyArgsAny as a0, GetArgsAny as a1, GetAggArgsAny as a2, VerifyManyArgsAny as a3, GetArgsInclude as a4, GetAggResponse as a5, GetManyResponse as a6, GetResponse as a7, Get as a8, GetResponseInclude as a9, GetResponseIncludeSelect as aa, GetResponseNoInclude as ab, DeepPartialWithNulls as ac, DeepPartialWithNullsItem as ad, DeepPartial as ae, Relation as af, InverseRelation as ag, PutArgs as ah, Put as ai, DeepKeys as aj, EntityMethods as ak, ValidateFieldDecoratorArgs as b, Driver as c, ComputedContext as d, CreateRadsDbArgs as e, CreateRadsDbClientArgs as f, RadsConfig as g, RadsConfigDataSource as h, RequiredFields as i, ValidateStringDecoratorArgs as j, CreateRadsArgsDrivers as k, RestDriverOptions as l, CreateRadsDbArgsNormalized as m, SchemaLoadResult as n, SchemaValidators as o, FileUploadResult as p, FileUploadDriver as q, RadsDbInstance as r, GetRestRoutesArgs as s, GetRestRoutesResponse as t, FileUploadArgs as u, FieldDefinition as v, EnumDefinition as w, ComputedContextGlobal as x, RadsHookDoc as y, RestFileUploadDriverOptions as z };
470
+ export { GetAggArgs as $, RestFileUploadDriverOptions as A, GenerateClientOptions as B, ComputedDecoratorArgs as C, DriverConstructor as D, EntityDecoratorArgs as E, FieldDecoratorArgs as F, GetRestRoutesOptions as G, GenerateClientNormalizedOptions as H, RadsVitePluginOptions as I, FileSystemNode as J, RadsUiSlotName as K, RadsUiSlotDefinition as L, MinimalDriver as M, RadsFeature as N, Change as O, PutEffect as P, GetManyArgs as Q, RadsRequestContext as R, Schema as S, TypeDefinition as T, UiDecoratorArgs as U, ValidateEntityDecoratorArgs as V, WhereJsonContains as W, VerifyManyArgs as X, VerifyManyResponse as Y, Where as Z, GetArgs as _, UiFieldDecoratorArgs as a, GetAggArgsAgg as a0, GetManyArgsAny as a1, GetArgsAny as a2, GetAggArgsAny as a3, VerifyManyArgsAny as a4, GetArgsInclude as a5, GetAggResponse as a6, GetManyResponse as a7, GetResponse as a8, Get as a9, GetResponseInclude as aa, GetResponseIncludeSelect as ab, GetResponseNoInclude as ac, DeepPartialWithNulls as ad, DeepPartialWithNullsItem as ae, DeepPartial as af, Relation as ag, InverseRelation as ah, PutArgs as ai, Put as aj, DeepKeys as ak, EntityMethods as al, ValidateFieldDecoratorArgs as b, Driver as c, ComputedContext as d, CreateRadsDbArgs as e, CreateRadsDbClientArgs as f, RadsConfig as g, RadsConfigDataSource as h, RequiredFields as i, ValidateStringDecoratorArgs as j, CreateRadsArgsDrivers as k, RestDriverOptions as l, CreateRadsDbArgsNormalized as m, SchemaLoadResult as n, SchemaValidators as o, FileUploadResult as p, FileUploadDriver as q, RadsDbInstance as r, GetRestRoutesArgs as s, GetRestRoutesResponse as t, FileUploadArgs as u, FieldDefinition as v, EnumDefinition as w, ComputedContextGlobal as x, RadsHookDoc as y, SqlDriverOptions as z };
package/drivers/sql.cjs CHANGED
@@ -124,7 +124,6 @@ const operatorHandlers = {
124
124
  parameters[`${pn}_${i}`] = v;
125
125
  inStrs.push(`@${pn}_${i}`);
126
126
  }
127
- parameters[pn] = whereVal;
128
127
  return `${namePrefix}${name} IN (${inStrs.join(", ")})`;
129
128
  },
130
129
  startsWith: (ctx, parameters, whereArgs) => {
package/drivers/sql.d.ts CHANGED
@@ -1,12 +1,4 @@
1
- import type { config } from 'mssql';
1
+ import type { SqlDriverOptions } from '@/types';
2
2
  import type { Schema } from 'rads-db';
3
- interface SqlDriverOptions {
4
- authentication: config['authentication'];
5
- server: config['server'];
6
- database: config['database'];
7
- options?: Omit<config, 'authentication' | 'server' | 'database'>;
8
- tablePrefix?: string;
9
- stagingTablePrefix?: string;
10
- }
11
3
  declare const _default: (options: SqlDriverOptions) => (schema: Schema, entity: string) => MinimalDriver;
12
4
  export default _default;
package/drivers/sql.mjs CHANGED
@@ -76,7 +76,6 @@ const operatorHandlers = {
76
76
  parameters[`${pn}_${i}`] = v;
77
77
  inStrs.push(`@${pn}_${i}`);
78
78
  }
79
- parameters[pn] = whereVal;
80
79
  return `${namePrefix}${name} IN (${inStrs.join(", ")})`;
81
80
  },
82
81
  startsWith: (ctx, parameters, whereArgs) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rads-db",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "Say goodbye to boilerplate code and hello to efficient and elegant syntax.",
5
5
  "author": "",
6
6
  "license": "ISC",