@@ -17,7 +17,7 @@ export interface IntrospectedColumn {
1717 /** Whether the column is nullable */
1818 nullable : boolean ;
1919 /** Default value if any */
20- defaultValue ?: any ;
20+ defaultValue ?: unknown ;
2121 /** Whether this is a primary key */
2222 isPrimary ?: boolean ;
2323 /** Whether this column has a unique constraint */
@@ -178,41 +178,41 @@ export interface Driver {
178178 readonly supports ?: DriverCapabilities ;
179179
180180 // Core CRUD methods
181- find ( objectName : string , query : any , options ?: any ) : Promise < any [ ] > ;
182- findOne ( objectName : string , id : string | number , query ?: any , options ?: any ) : Promise < any > ;
183- create ( objectName : string , data : any , options ?: any ) : Promise < any > ;
184- update ( objectName : string , id : string | number , data : any , options ?: any ) : Promise < any > ;
185- delete ( objectName : string , id : string | number , options ?: any ) : Promise < any > ;
186- count ( objectName : string , filters : any , options ?: any ) : Promise < number > ;
181+ find ( objectName : string , query : object , options ?: Record < string , unknown > ) : Promise < Record < string , unknown > [ ] > ;
182+ findOne ( objectName : string , id : string | number , query ?: object , options ?: Record < string , unknown > ) : Promise < Record < string , unknown > | null > ;
183+ create ( objectName : string , data : Record < string , unknown > , options ?: Record < string , unknown > ) : Promise < Record < string , unknown > > ;
184+ update ( objectName : string , id : string | number , data : Record < string , unknown > , options ?: Record < string , unknown > ) : Promise < Record < string , unknown > > ;
185+ delete ( objectName : string , id : string | number , options ?: Record < string , unknown > ) : Promise < unknown > ;
186+ count ( objectName : string , filters : object , options ?: Record < string , unknown > ) : Promise < number > ;
187187
188188 // Lifecycle methods
189189 connect ?( ) : Promise < void > ;
190190 disconnect ?( ) : Promise < void > ;
191191 checkHealth ?( ) : Promise < boolean > ;
192192
193193 // Bulk operations
194- execute ?( command : any , parameters ?: any [ ] , options ?: any ) : Promise < any > ;
195- bulkCreate ?( objectName : string , data : any [ ] , options ?: any ) : Promise < any > ;
196- bulkUpdate ?( objectName : string , updates : Array < { id : string | number , data : any } > , options ?: any ) : Promise < any > ;
197- bulkDelete ?( objectName : string , ids : Array < string | number > , options ?: any ) : Promise < any > ;
194+ execute ?( command : object , parameters ?: unknown [ ] , options ?: Record < string , unknown > ) : Promise < unknown > ;
195+ bulkCreate ?( objectName : string , data : Record < string , unknown > [ ] , options ?: Record < string , unknown > ) : Promise < unknown > ;
196+ bulkUpdate ?( objectName : string , updates : Array < { id : string | number , data : Record < string , unknown > } > , options ?: Record < string , unknown > ) : Promise < unknown > ;
197+ bulkDelete ?( objectName : string , ids : Array < string | number > , options ?: Record < string , unknown > ) : Promise < unknown > ;
198198
199199 // Query extensions
200- distinct ?( objectName : string , field : string , filters ?: any , options ?: any ) : Promise < any [ ] > ;
201- aggregate ?( objectName : string , query : any , options ?: any ) : Promise < any [ ] > ;
200+ distinct ?( objectName : string , field : string , filters ?: object , options ?: Record < string , unknown > ) : Promise < unknown [ ] > ;
201+ aggregate ?( objectName : string , query : object , options ?: Record < string , unknown > ) : Promise < Record < string , unknown > [ ] > ;
202202
203203 // Transaction support
204- beginTransaction ?( ) : Promise < any > ;
204+ beginTransaction ?( ) : Promise < unknown > ;
205205 /** @deprecated Use `commit` — aligned with @objectstack/spec DriverInterfaceSchema. Will be removed in v5.0. */
206- commitTransaction ?( transaction : any ) : Promise < void > ;
206+ commitTransaction ?( transaction : unknown ) : Promise < void > ;
207207 /** @deprecated Use `rollback` — aligned with @objectstack/spec DriverInterfaceSchema. Will be removed in v5.0. */
208- rollbackTransaction ?( transaction : any ) : Promise < void > ;
208+ rollbackTransaction ?( transaction : unknown ) : Promise < void > ;
209209 /** Commit a transaction (spec-aligned name) */
210- commit ?( transaction : any ) : Promise < void > ;
210+ commit ?( transaction : unknown ) : Promise < void > ;
211211 /** Rollback a transaction (spec-aligned name) */
212- rollback ?( transaction : any ) : Promise < void > ;
212+ rollback ?( transaction : unknown ) : Promise < void > ;
213213
214214 // Schema / Lifecycle
215- init ?( objects : any [ ] ) : Promise < void > ;
215+ init ?( objects : object [ ] ) : Promise < void > ;
216216
217217 /**
218218 * Introspect the database schema to discover existing tables, columns, and relationships.
@@ -221,32 +221,32 @@ export interface Driver {
221221 introspectSchema ?( ) : Promise < IntrospectedSchema > ;
222222
223223 // Bulk / Atomic (alternative signatures)
224- createMany ?( objectName : string , data : any [ ] , options ?: any ) : Promise < any > ;
225- updateMany ?( objectName : string , filters : any , data : any , options ?: any ) : Promise < any > ;
226- deleteMany ?( objectName : string , filters : any , options ?: any ) : Promise < any > ;
227- findOneAndUpdate ?( objectName : string , filters : any , update : any , options ?: any ) : Promise < any > ;
224+ createMany ?( objectName : string , data : Record < string , unknown > [ ] , options ?: Record < string , unknown > ) : Promise < unknown > ;
225+ updateMany ?( objectName : string , filters : object , data : Record < string , unknown > , options ?: Record < string , unknown > ) : Promise < unknown > ;
226+ deleteMany ?( objectName : string , filters : object , options ?: Record < string , unknown > ) : Promise < unknown > ;
227+ findOneAndUpdate ?( objectName : string , filters : object , update : Record < string , unknown > , options ?: Record < string , unknown > ) : Promise < Record < string , unknown > | null > ;
228228
229229 // DriverInterface v4.0 methods
230230 /**
231231 * Execute a query using QueryAST format (DriverInterface v4.0)
232232 */
233- executeQuery ?( ast : any , options ?: any ) : Promise < { value : any [ ] ; count ?: number } > ;
233+ executeQuery ?( ast : object , options ?: Record < string , unknown > ) : Promise < { value : Record < string , unknown > [ ] ; count ?: number } > ;
234234
235235 /**
236236 * Execute a command using Command format (DriverInterface v4.0)
237237 */
238- executeCommand ?( command : any , options ?: any ) : Promise < { success : boolean ; data ?: any ; affected : number } > ;
238+ executeCommand ?( command : object , options ?: Record < string , unknown > ) : Promise < { success : boolean ; data ?: unknown ; affected : number } > ;
239239
240240 /**
241241 * Alternative method name for findOne (some drivers use 'get')
242242 */
243- get ?( objectName : string , id : string , options ?: any ) : Promise < any > ;
243+ get ?( objectName : string , id : string , options ?: Record < string , unknown > ) : Promise < Record < string , unknown > | null > ;
244244
245245 /**
246246 * Direct query execution (legacy)
247247 */
248- directQuery ?( sql : string , params ?: any [ ] ) : Promise < any [ ] > ;
249- query ?( sql : string , params ?: any [ ] ) : Promise < any [ ] > ;
248+ directQuery ?( sql : string , params ?: unknown [ ] ) : Promise < Record < string , unknown > [ ] > ;
249+ query ?( sql : string , params ?: unknown [ ] ) : Promise < Record < string , unknown > [ ] > ;
250250
251251 // ========================================================================
252252 // Methods from @objectstack /spec DriverInterfaceSchema
@@ -261,7 +261,7 @@ export interface Driver {
261261 * @param options - Driver options.
262262 * @returns The upserted record.
263263 */
264- upsert ?( objectName : string , data : Record < string , unknown > , options ?: any ) : Promise < any > ;
264+ upsert ?( objectName : string , data : Record < string , unknown > , options ?: Record < string , unknown > ) : Promise < Record < string , unknown > > ;
265265
266266 /**
267267 * Stream records matching the structured query.
@@ -272,7 +272,7 @@ export interface Driver {
272272 * @param options - Driver options.
273273 * @returns AsyncIterable/ReadableStream of records.
274274 */
275- findStream ?( objectName : string , query : any , options ?: any ) : AsyncIterable < any > | any ;
275+ findStream ?( objectName : string , query : object , options ?: Record < string , unknown > ) : AsyncIterable < Record < string , unknown > > | unknown ;
276276
277277 /**
278278 * Get connection pool statistics.
@@ -289,15 +289,15 @@ export interface Driver {
289289 * @param objects - Object definitions to synchronize.
290290 * @param options - Driver options.
291291 */
292- syncSchema ?( objects : any [ ] , options ?: any ) : Promise < void > ;
292+ syncSchema ?( objects : object [ ] , options ?: Record < string , unknown > ) : Promise < void > ;
293293
294294 /**
295295 * Drop a table/collection by name.
296296 *
297297 * @param objectName - The name of the object/table to drop.
298298 * @param options - Driver options.
299299 */
300- dropTable ?( objectName : string , options ?: any ) : Promise < void > ;
300+ dropTable ?( objectName : string , options ?: Record < string , unknown > ) : Promise < void > ;
301301
302302 /**
303303 * Explain the execution plan for a query.
@@ -308,6 +308,6 @@ export interface Driver {
308308 * @param options - Driver options.
309309 * @returns Execution plan details.
310310 */
311- explain ?( objectName : string , query : any , options ?: any ) : Promise < any > ;
311+ explain ?( objectName : string , query : object , options ?: Record < string , unknown > ) : Promise < unknown > ;
312312}
313313
0 commit comments