brianc / node-sql

SQL generation for node.js
MIT License
1.05k stars 191 forks source link

Update TableDefinition type be compatible with shorthand usage #406

Closed bunsenmcdubbs closed 4 years ago

bunsenmcdubbs commented 5 years ago

Previous typedef for TableDefinition was not compatible with common document usage/examples

import * as sql from 'sql';

const user = sql.define({
  name: 'user',
  columns: ['id', 'name', 'email', 'lastLogin'] // string[] not compatible with {[CName in keyof Row]: ColumnDefinition<CName, Row[CName]>}; 
});
karianpour commented 5 years ago

I have the same issue, is there any workaround available?