getTableColumns method
Get the tableName
columns as array of:
- name (string),
- type (string),
- isPrimaryKey (int, 1 for true)
- notnull (int).
Implementation
@override
List<List<dynamic>> getTableColumns(TableName tableName) {
checkOpen();
String sql = "PRAGMA table_info(${tableName.fixedName})";
List<List<dynamic>> columnsList = [];
var res = select(sql);
res.forEach((QueryResultRow row) {
String colName = row.get('name');
String colType = row.get('type');
int isPk = row.get('pk');
int notNull = row.get('notnull');
columnsList.add([colName, colType, isPk, notNull]);
});
return columnsList;
}