@nodescript/adapter-sql-protocol
Advanced tools
Comparing version 1.0.0 to 1.1.0
import { DomainDef } from '@nodescript/protocomm'; | ||
import { SqlModificationResult } from '../schema/SqlModificationResult.js'; | ||
import { SqlQueryResult } from '../schema/SqlQueryResult.js'; | ||
@@ -8,17 +7,6 @@ export interface SqlDomain { | ||
}): Promise<{}>; | ||
executeDefinition(req: { | ||
query(req: { | ||
connectionUrl: string; | ||
definition: string; | ||
}): Promise<{}>; | ||
executeModification(req: { | ||
connectionUrl: string; | ||
modification: string; | ||
params: any[]; | ||
}): Promise<{ | ||
result: SqlModificationResult; | ||
}>; | ||
executeQuery(req: { | ||
connectionUrl: string; | ||
query: string; | ||
params: any[]; | ||
params?: any[]; | ||
}): Promise<{ | ||
@@ -25,0 +13,0 @@ result: SqlQueryResult; |
@@ -1,2 +0,1 @@ | ||
import { SqlModificationResultSchema } from '../schema/SqlModificationResult.js'; | ||
import { SqlQueryResultSchema } from '../schema/SqlQueryResult.js'; | ||
@@ -13,25 +12,12 @@ export const SqlDomain = { | ||
}, | ||
executeDefinition: { | ||
query: { | ||
type: 'command', | ||
params: { | ||
connectionUrl: { type: 'string' }, | ||
definition: { type: 'string' }, | ||
}, | ||
returns: {}, | ||
}, | ||
executeModification: { | ||
type: 'command', | ||
params: { | ||
connectionUrl: { type: 'string' }, | ||
modification: { type: 'string' }, | ||
params: { type: 'array', items: { type: 'any' } } | ||
}, | ||
returns: { result: SqlModificationResultSchema.schema } | ||
}, | ||
executeQuery: { | ||
type: 'command', | ||
params: { | ||
connectionUrl: { type: 'string' }, | ||
query: { type: 'string' }, | ||
params: { type: 'array', items: { type: 'any' } }, | ||
params: { | ||
type: 'array', | ||
items: { type: 'any' }, | ||
optional: true | ||
}, | ||
}, | ||
@@ -38,0 +24,0 @@ returns: { result: SqlQueryResultSchema.schema } |
import { Schema } from 'airtight'; | ||
import { FieldInfo } from './FieldInfo.js'; | ||
export interface SqlQueryResult { | ||
rows: Record<string, any>[]; | ||
rowCount: number; | ||
fieldData: FieldInfo[]; | ||
rows?: Record<string, any>[]; | ||
rowCount?: number; | ||
fieldData?: FieldInfo[]; | ||
} | ||
export declare const SqlQueryResultSchema: Schema<SqlQueryResult>; |
@@ -12,8 +12,10 @@ import { Schema } from 'airtight'; | ||
additionalProperties: { type: 'any' } | ||
} | ||
}, | ||
optional: true | ||
}, | ||
rowCount: { type: 'integer' }, | ||
rowCount: { type: 'integer', optional: true }, | ||
fieldData: { | ||
type: 'array', | ||
items: FieldInfoSchema.schema, | ||
optional: true | ||
} | ||
@@ -20,0 +22,0 @@ } |
{ | ||
"name": "@nodescript/adapter-sql-protocol", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "SQL Adapter Protocol", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
7603
137