tableNameToKey static method
Implementation
static AbstractKey tableNameToKey(String tableName) {
var key = <AbstractKey>[
UtilsKey(),
DocKey(),
LocalDocKey(),
SequenceKey(),
ViewMetaKey(),
ViewDocMetaKey(viewName: ''),
ViewKeyMetaKey(viewName: '')
].firstWhereOrNull((key) => tableName.startsWith(key.tableName));
if (key != null) {
if (key is ViewDocMetaKey) {
key = ViewDocMetaKey(viewName: tableName.split('!')[1]);
}
if (key is ViewKeyMetaKey) {
key = ViewKeyMetaKey(viewName: tableName.split('!')[1]);
}
return key;
}
throw Exception('Invalid key for table');
}