RangeError: Invalid value: Not in range 0..1114111, inclusive: -1 when trying to use upgrade command

RangeError: Invalid value: Not in range 0..1114111, inclusive: -1 when trying to use upgrade command

渡槽数据库升级.... -- 渡槽 CLI 版本:3.3.0 -- 渡槽项目版本:3.3.0-b1 *** 未捕获的错误 RangeError:无效值:不在范围 0..1114111 内,包括:-1 **** 堆栈跟踪 * #0 StringBuffer.writeCharCode (飞镖:core-patch/string_buffer_patch.飞镖:76:9) * #1 PostgreSQLFormat.substitute(包:postgres/src/substituter.dart:83:29) * #2 Query.sendExtended(包:postgres/src/query.dart:61:38) * #3 _PostgreSQLConnectionStateIdle.processQuery(包:postgres/src/connection_fsm.dart:182:9) * #4 _PostgreSQLConnectionStateIdle.awake(包:postgres/src/connection_fsm.dart:168:14) * #5 _PostgreSQLExecutionContextMixin._enqueue(包:postgres/src/connection.dart:399:67) * #6 _PostgreSQLExecutionContextMixin.query(包:postgres/src/connection.dart:318:12) * #7 PostgreSQLPersistentStore.execute(包:aqueduct/src/db/postgresql/postgresql_persistent_store.dart:153:37) * * #8 PostgreSQLPersistentStore.schemaVersion(包:aqueduct/src/db/postgresql/postgresql_persistent_store.dart:216:26) * #9 CLIDatabaseUpgrade.handle(包:aqueduct/src/cli/commands/db_upgrade.dart:28:52) * #10 CLICommand.process(包:aqueduct/src/cli/command.dart:159:20) * * #11 CLICommand.process(包:aqueduct/src/cli/command.dart:135:12) * #12 CLICommand.process(包:aqueduct/src/cli/command.dart:135:12) * #13 main (file:///C:/Users/khalid/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/aqueduct-3.3.0/bin/aqueduct.dart:9:27) * #14 _startIsolate。 (飞镖:isolate-patch/isolate_patch.飞镖:299:32) * #15 _RawReceivePortImpl._handleMessage (飞镖:isolate-patch/isolate_patch.飞镖:168:12)


这是 dart 2.8 中的重大变化。降级到 dart 2.7

另一个最适合我的解决方案是覆盖 postgres 对 aqueduct 的依赖:

dependencies:
    aqueduct: ^3.3.0+1
    # other dependencies

dependency_overrides:
    postgres: ^2.1.1

这也是 in their official GitHub issues 另一个 postgres 相关问题的建议