Skip to content

Commit fa3c4d1

Browse files
authored
Update interface
1 parent 6137abd commit fa3c4d1

File tree

4 files changed

+6
-75
lines changed

4 files changed

+6
-75
lines changed

libs/node/model/index.d.ts

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,6 @@
33

44
/* auto-generated by NAPI-RS */
55

6-
export const enum JsDevupModelColumnType {
7-
String = 'String',
8-
Text = 'Text',
9-
Boolean = 'Boolean',
10-
Integer = 'Integer',
11-
SmallInteger = 'SmallInteger',
12-
BigInteger = 'BigInteger',
13-
Float = 'Float',
14-
Number = 'Number',
15-
Date = 'Date',
16-
Time = 'Time',
17-
DateTime = 'DateTime',
18-
Binary = 'Binary',
19-
Enum = 'Enum',
20-
Any = 'Any'
21-
}
22-
export interface JsDevupModelColumn {
23-
name?: string
24-
type?: JsDevupModelColumnType
25-
default?: Func | string | boolean | number | null | (() => string | number | boolean | null)
26-
nullable?: boolean
27-
primaryKey?: boolean
28-
autoIncrement?: boolean
29-
foreignKey?: string
30-
unique?: string | boolean
31-
index?: string | boolean
32-
comment?: string
33-
}
34-
export declare function Column(options?: JsDevupModelColumn | undefined | null): (...args: any[]) => any
35-
/** Model decorator */
36-
export declare function Model(name?: string | undefined | null): (...args: any[]) => any
376
/** DevupModelColumn */
387
export interface DevupModelColumn {
398
name: string
@@ -78,6 +47,8 @@ export interface DevupModelColumnOptions {
7847
}
7948
/** Column decorator */
8049
export declare function Column(options?: DevupModelColumnOptions | undefined | null): (...args: any[]) => any
50+
/** Model decorator */
51+
export declare function Model(name?: string | undefined | null): (...args: any[]) => any
8152
export type JsFunc = Func
8253
export declare class Func {
8354
value: string

libs/node/model/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,9 @@ if (!nativeBinding) {
310310
throw new Error(`Failed to load native binding`)
311311
}
312312

313-
const { JsDevupModelColumnType, Column, Func, Model, DevupModelColumnType, Column } = nativeBinding
313+
const { DevupModelColumnType, Func, Column, Model } = nativeBinding
314314

315-
module.exports.JsDevupModelColumnType = JsDevupModelColumnType
316-
module.exports.Column = Column
317-
module.exports.Func = Func
318-
module.exports.Model = Model
319315
module.exports.DevupModelColumnType = DevupModelColumnType
316+
module.exports.Func = Func
320317
module.exports.Column = Column
318+
module.exports.Model = Model

sql/libs/node/sqlite/index.d.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,6 @@
33

44
/* auto-generated by NAPI-RS */
55

6-
/** DevupModelColumn */
7-
export interface DevupModelColumn {
8-
name: string
9-
type: DevupModelColumnType
10-
default: Func | string | boolean | number | null | (() => string | number | boolean | null)
11-
nullable: boolean
12-
primaryKey: boolean
13-
autoIncrement: boolean
14-
foreignKey?: unknown
15-
unique?: string | boolean | string[]
16-
index?: string | boolean | string[]
17-
comment?: string
18-
}
19-
/** DevupModelColumnType */
20-
export const enum DevupModelColumnType {
21-
String = 'String',
22-
Text = 'Text',
23-
Boolean = 'Boolean',
24-
Integer = 'Integer',
25-
SmallInteger = 'SmallInteger',
26-
BigInteger = 'BigInteger',
27-
Float = 'Float',
28-
Number = 'Number',
29-
Date = 'Date',
30-
Time = 'Time',
31-
DateTime = 'DateTime',
32-
Binary = 'Binary',
33-
Enum = 'Enum',
34-
Any = 'Any'
35-
}
366
export interface JsDevupSqlRevisionAction {
377
action: string
388
table: string
@@ -60,12 +30,6 @@ export interface GenerateRevisionActionSqlWithParams {
6030
params: Array<string>
6131
}
6232
export declare function createSqliteConnection(options: DevupNodeSqlPoolOptions): Promise<DevupNodeSqlPool>
63-
export type JsFunc = Func
64-
export declare class Func {
65-
value: string
66-
static new(value: string): JsFunc
67-
static now(): JsFunc
68-
}
6933
export declare class DevupNodeSqlPool {
7034
execute(sql: string, params?: Array<string> | undefined | null, tx?: DevupNodeSqlTransaction | undefined | null): Promise<void>
7135
fetchAll(sql: string, params?: Array<string> | undefined | null, tx?: DevupNodeSqlTransaction | undefined | null): Promise<Array<Record<string, any>>>

sql/libs/node/sqlite/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,8 @@ if (!nativeBinding) {
310310
throw new Error(`Failed to load native binding`)
311311
}
312312

313-
const { DevupModelColumnType, Func, DevupNodeSqlPool, DevupNodeSqlTransaction, createSqliteConnection } = nativeBinding
313+
const { DevupNodeSqlPool, DevupNodeSqlTransaction, createSqliteConnection } = nativeBinding
314314

315-
module.exports.DevupModelColumnType = DevupModelColumnType
316-
module.exports.Func = Func
317315
module.exports.DevupNodeSqlPool = DevupNodeSqlPool
318316
module.exports.DevupNodeSqlTransaction = DevupNodeSqlTransaction
319317
module.exports.createSqliteConnection = createSqliteConnection

0 commit comments

Comments
 (0)