File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
packages/powersync/lib/src Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,7 @@ class PowerSyncDatabaseImpl
261
261
if (disconnecter != null ) {
262
262
throw AssertionError ('Cannot update schema while connected' );
263
263
}
264
+ schema.validate ();
264
265
this .schema = schema;
265
266
return updateSchemaInIsolate (database, schema);
266
267
}
Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ class Schema {
11
11
const Schema (this .tables);
12
12
13
13
Map <String , dynamic > toJson () => {'tables' : tables};
14
+
15
+ void validate () {
16
+ for (var table in tables) {
17
+ table.validate ();
18
+ }
19
+ }
14
20
}
15
21
16
22
/// A single table in the schema.
@@ -106,6 +112,12 @@ class Table {
106
112
107
113
columnNames.add (column.name);
108
114
}
115
+
116
+ if (columns.length > 63 ) {
117
+ throw AssertionError (
118
+ "Table $name has ${columns .length } columns, maximum is 63." );
119
+ }
120
+
109
121
Set <String > indexNames = {};
110
122
111
123
for (var index in indexes) {
You can’t perform that action at this time.
0 commit comments