Skip to content
This repository was archived by the owner on Mar 18, 2021. It is now read-only.
This repository was archived by the owner on Mar 18, 2021. It is now read-only.

Problem when migrating an empty database #841

Closed

Description

@chrisnorman7

Hi,
I've got all the code for my database sorted. flutter analyze --watch continues to give me no errors (with the latest analysis file from https://raw.githubusercontent.com/flutter/flutter/master/analysis_options.yaml), but I am getting the following error when running aqueduct db upgrade.

I've successfully ran aqueduct db generate, and one file has been generated.

I've created by app user with the createdb permission, as directed by the manual.

Any help would be greatly appreciated.

-- Aqueduct CLI Version: 3.3.0+1
-- Aqueduct project version: 3.3.0-b1
*** Uncaught error
RangeError: Invalid value: Not in range 0..1114111, inclusive: -1
**** Stacktrace


Activity

  1. chrisnorman7 commented on May 15, 2020

    @chrisnorman7
    Author

    Should probably have put my versions in here:

    • Dart VM version: 2.8.2 (stable) (Unknown timestamp) on "linux_x64"
    • Aqueduct CLI version: 3.3.0+1
    • psql (PostgreSQL) 12.3

    I'm more than happy to provide any other info that is relevant.

  2. itsjoeconway commented on May 15, 2020

    @itsjoeconway
    Contributor

    Switch to 4.0.0-b1, it depends on an updated postgres driver. Unfortunately, Dart 2.8 had a breaking change that impacted v1 of the postgres driver.

  3. chrisnorman7 commented on May 15, 2020

    @chrisnorman7
    Author
  4. itsjoeconway commented on May 15, 2020

    @itsjoeconway
    Contributor

    Strange - I thought 4.0.0 was available on pub, but it is not. A bad release went into pub and it caused all kinds of chaos that we unfortunately have not had the time to resolve yet. You might have to install Dart 2.7 and switch that and Dart 2.8 for Flutter/Aqueduct for the time being.

  5. chrisnorman7 commented on May 15, 2020

    @chrisnorman7
    Author
  6. tedwong commented on May 25, 2020

    @tedwong

    does it means that it is not dart 2.8 ready?

  7. dxps commented on May 27, 2020

    @dxps

    @joeconwaystk Thanks for the feedback.
    Indeed, a version 2 (2.1.1 actually) of postgres dependency exists. If that's the only change needed, then it should be quite easy to fix. How can we/I help in this case?

    I love the quality of the documentation and the whole experience with this lovely framework, so I really try to help/contribute.

    @tedwong Yes, for now. Although this particular issue it's not strictly related to Aqueduct.

  8. edufolly commented on May 28, 2020

    @edufolly

    If you want to use dart > 2.7.0, you can add to pubspec.yaml:

    dependency_overrides:
      postgres: 2.1.1

    To use aqueduct to upgrade the database:
    pub run aqueduct db upgrade

    I don't have problems to use aqueduct with recent PostgreSQL plugin.

  9. dxps commented on May 29, 2020

    @dxps

    @edufolly Thanks a lot for the help, Eduardo! Indeed, this approach is working just great.
    I need to look into the details of pub to get the full picture.

  10. dxps commented on Jun 1, 2020

    @dxps

    Today Aqueduct version 4.0.0-b1 has been published on pub.dev.

    You can install the CLI using pub global activate aqueduct 4.0.0-b1

    And in the project's pubspec.yaml you can use it, together with the updated version of aqueduct_test as below:

    ...
    dependencies:
      aqueduct: ^4.0.0-b1
    
    dev_dependencies:
      test: ^1.0.0
      aqueduct_test: ^2.0.0-b1

    And all of these using the recently released Dart SDK 2.8.3. Yay! 😄

  11. chrisnorman7 commented on Jun 1, 2020

    @chrisnorman7
    Author
  12. pst9354 commented on Jun 2, 2020

    @pst9354

    After upgrading to 4.0.0-b1, I tried to compile the project with:
    dart2native bin\main.dart -k aot

    error: import of dart:mirrors is not supported in the current Dart runtime

    Failed to generate native files:
    Generating AOT snapshot failed!

    Did I miss something???

  13. dxps commented on Jun 2, 2020

    @dxps

    @pst9354 You're right, Patrik. The current - 4.0.0-b1 - version still includes dart:mirrors in multiple places.

    @joeconwaystk I am seriously consider investing time and energy on this wonderful framework and try to contribute. Did you mentioned somewhere the strategy to get rid off the dart:mirrors dependency?

    I guess any alternative would be based on code generation before the final build, so indeed at runtime there won't be any dynamic nature of such reflection.
    Not sure right now if an alternative such as Reflectable can be considered.

    Or simply use source_gen on an Aqueduct own library declared under dev_dependencies section of the pubspec.yaml.

    Oh, and thinking about it, I just found out a recent talk on Code generation with the Dart build system by Kevin Moore. I need to take a look on it.

  14. dxps commented on Jun 2, 2020

    @dxps

    @chrisnorman7 Oh, just for the sake or having things organized, I would close this issue.

    @pst9354 I found out the issue where the AOT topic is being "officially" addressed. This is #669 so all of us interested on this topic can talk/watch on it.

  15. chrisnorman7 commented on Jun 2, 2020

    @chrisnorman7
    Author

    Yeah, sorry, I always forget I have to do that. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions