@carbonorm/carbonnode 3.0.13 → 3.0.15

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.
@@ -60,6 +60,7 @@ export declare const C6Constants: {
60
60
  LOCALTIMESTAMP: string;
61
61
  MAKEDATE: string;
62
62
  MAKETIME: string;
63
+ MATCH_AGAINST: string;
63
64
  MONTHNAME: string;
64
65
  MICROSECOND: string;
65
66
  MINUTE: string;
@@ -2,7 +2,9 @@ import { Executor } from "../executors/Executor";
2
2
  import { iRestMethods } from "../types/ormInterfaces";
3
3
  interface QueryResult {
4
4
  sql: string;
5
- params: any[];
5
+ params: any[] | {
6
+ [key: string]: any;
7
+ };
6
8
  }
7
9
  export declare abstract class SqlBuilder<RequestMethod extends iRestMethods, RestShortTableName extends string = any, RestTableInterface extends Record<string, any> = any, PrimaryKey extends Extract<keyof RestTableInterface, string> = Extract<keyof RestTableInterface, string>, CustomAndRequiredFields extends {
8
10
  [key: string]: any;
@@ -11,11 +13,21 @@ export declare abstract class SqlBuilder<RequestMethod extends iRestMethods, Res
11
13
  } = {
12
14
  [key in keyof RestTableInterface]: any;
13
15
  }> extends Executor<RequestMethod, RestShortTableName, RestTableInterface, PrimaryKey, CustomAndRequiredFields, RequestTableOverrides> {
14
- /** Generate nested WHERE/JOIN conditions with parameter binding */
15
- protected buildBooleanJoinedConditions(set: any, andMode?: boolean, params?: any[]): string;
16
- /** Translate array or function calls into SQL expressions */
16
+ /** Flag to determine if named placeholders should be used */
17
+ protected useNamedParams: boolean;
18
+ private convertHexIfBinary;
19
+ /** Generate nested WHERE/ON conditions with parameter binding (supports AND/OR/NOT) */
20
+ protected buildBooleanJoinedConditions(set: any, andMode?: boolean, params?: any[] | {
21
+ [key: string]: any;
22
+ }): string;
23
+ /** Translate array or function call definitions into SQL expressions (supports nested calls) */
17
24
  protected buildAggregateField(field: string | any[]): string;
18
- /** Compose a parameterized SELECT query with optional JOIN/WHERE/GROUP/HAVING/PAGINATION */
25
+ private buildJoinClauses;
26
+ private buildPaginationClause;
27
+ private buildWhereClause;
19
28
  protected buildSelectQuery<RestShortTableNames>(table: RestShortTableNames, primary: string | undefined, args: any, isSubSelect?: boolean): QueryResult;
29
+ protected buildUpdateQuery(table: RestShortTableName, data: Partial<RestTableInterface>, args?: any): QueryResult;
30
+ /** Compose a DELETE query with optional JOIN and WHERE clauses */
31
+ protected buildDeleteQuery(table: RestShortTableName, args?: any): QueryResult;
20
32
  }
21
33
  export {};
@@ -1,6 +1,6 @@
1
1
  import { SqlBuilder } from "api/builders/sqlBuilder";
2
2
  import { apiReturn, DetermineResponseDataType, iRestMethods } from "../types/ormInterfaces";
3
- import { RowDataPacket, ResultSetHeader } from 'mysql2/promise';
3
+ import { ResultSetHeader } from 'mysql2/promise';
4
4
  export declare class SqlExecutor<RequestMethod extends iRestMethods, RestShortTableName extends string = any, RestTableInterface extends Record<string, any> = any, PrimaryKey extends Extract<keyof RestTableInterface, string> = Extract<keyof RestTableInterface, string>, CustomAndRequiredFields extends Record<string, any> = any, RequestTableOverrides extends {
5
5
  [key in keyof RestTableInterface]: any;
6
6
  } = {
@@ -8,9 +8,41 @@ export declare class SqlExecutor<RequestMethod extends iRestMethods, RestShortTa
8
8
  }> extends SqlBuilder<RequestMethod, RestShortTableName, RestTableInterface, PrimaryKey, CustomAndRequiredFields, RequestTableOverrides> {
9
9
  execute(): Promise<apiReturn<DetermineResponseDataType<RequestMethod, RestTableInterface>>>;
10
10
  private withConnection;
11
- select<TName extends string>(table: TName, primary: string | undefined, args: any): Promise<RowDataPacket[]>;
12
- insert<TName extends string>(table: TName, data: Record<string, any>): Promise<ResultSetHeader>;
13
- update<TName extends string>(table: TName, primary: string[], data: Record<string, any>): Promise<ResultSetHeader>;
14
- delete<TName extends string>(table: TName, primary: string[], args: Record<string, any>): Promise<ResultSetHeader>;
15
- formatSQLWithParams(sql: string, params: any[]): string;
11
+ serialize: (row: any) => {
12
+ [k: string]: unknown;
13
+ };
14
+ select<TName extends string>(table: TName, primary: string | undefined, args: any): Promise<{
15
+ rest: {
16
+ [k: string]: unknown;
17
+ }[];
18
+ sql: {
19
+ sql: any;
20
+ values: any;
21
+ };
22
+ }>;
23
+ insert<TName extends string>(table: TName, data: Record<string, any>): Promise<{
24
+ rest: ResultSetHeader;
25
+ sql: {
26
+ sql: string;
27
+ placeholders: string;
28
+ };
29
+ }>;
30
+ update<TName extends string>(table: TName, primary: string[], data: Record<string, any>): Promise<{
31
+ rest: ResultSetHeader;
32
+ sql: {
33
+ sql: string;
34
+ values: any[];
35
+ };
36
+ }>;
37
+ delete<TName extends string>(table: TName, primary: string[], args: Record<string, any>): Promise<{
38
+ rest: ResultSetHeader;
39
+ sql: {
40
+ sql: string;
41
+ args: Record<string, any>;
42
+ };
43
+ }>;
44
+ formatSQLWithParams(sql: string, params: any[] | {
45
+ [key: string]: any;
46
+ }): string;
47
+ private formatValue;
16
48
  }