Skip to content

Commit e55288b

Browse files
committed
Increase column limit to 1999.
1 parent 7694d31 commit e55288b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/powersync_core/lib/src/schema.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ class Table {
4646
/// Override the name for the view
4747
final String? _viewNameOverride;
4848

49-
/// There is maximum of 127 arguments for any function in SQLite. Currently we use json_object which uses 1 arg per key (column name)
50-
/// and one per value, which limits it to 63 arguments.
51-
final int maxNumberOfColumns = 63;
49+
/// powersync-sqlite-core limits the number of columns
50+
/// per table to 1999, due to internal SQLite limits.
51+
///
52+
/// In earlier versions this was limited to 63.
53+
final int maxNumberOfColumns = 1999;
5254

5355
/// Internal use only.
5456
///

packages/powersync_core/test/schema_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ void main() {
303303

304304
test('Table with too many columns', () {
305305
final List<Column> manyColumns = List.generate(
306-
64, // Exceeds MAX_NUMBER_OF_COLUMNS
306+
2000, // Exceeds MAX_NUMBER_OF_COLUMNS
307307
(index) => Column('col$index', ColumnType.text),
308308
);
309309

0 commit comments

Comments
 (0)