RangeError:无效值:不在范围 0..1114111 内,包括:尝试使用升级命令时出现 -1
aqueduct db 升级.... -- Aqueduct CLI 版本:3.3.0 -- Aqueduct 项目版本:3.3.0-b1 *** 未捕获错误 RangeError:无效值:不在范围 0..1114111 内,包括:-1 **** 堆栈跟踪 * #0 StringBuffer.writeCharCode (dart:core-patch/string_buffer_patch.dart:76:9) * #1 PostgreSQLFormat.substitute (package:postgres/src/substituter.dart:83:29) * #2 Query.sendExtended (package:postgres/src/query.dart:61:38) * #3 _PostgreSQLConnectionStateIdle.processQuery (package: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。 (dart:isolate-patch/isolate_patch.dart:299:32) * #15 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
这是 dart 2.8 中的重大变化。降级至 dart 2.7
对我来说最有效的另一个解决方案是覆盖 postgres 对 aqueduct 的依赖:
dependencies:
aqueduct: ^3.3.0+1
# other dependencies
dependency_overrides:
postgres: ^2.1.1
这也是 在他们的官方 GitHub 问题 中针对另一个 postgres 相关问题提出的建议