Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File table and dart:io File clash #2904

Closed
albe-jj opened this issue Feb 28, 2024 · 4 comments
Closed

File table and dart:io File clash #2904

albe-jj opened this issue Feb 28, 2024 · 4 comments

Comments

@albe-jj
Copy link

albe-jj commented Feb 28, 2024

If I have import 'dart:io' as io; in the file where I define the database tables, and a table named @DataClassName("File") then in the database.g.dart file it uses io.File instead of the File dataclass.

Removing the import 'dart:io' as io; from database.dart resolve the issue.

@simolus3
Copy link
Owner

Thanks for the report! Unfortunately it's a bit tricky to know which import was meant because that part of the code is not set up to deal with exports correctly, but at least for dart: vs package: URIs we should be able to prevent this.

@bbjay
Copy link

bbjay commented Mar 11, 2024

I also ran into this issue after upgrading from 2.12.1 to 2.16.0
Is there a way to test the fix or is a 2.17.0 release imminent anyway?

@simolus3
Copy link
Owner

You can use the current development version of the builder until the next release (no ETA yet, sorry):

dependency_overrides:
  drift_dev:
    git:
      url: https://github.com/simolus3/drift.git
      ref: develop
      path: drift_dev

Let me know if that fixes the issue for you.

@bbjay
Copy link

bbjay commented Mar 12, 2024

@simolus3 thanks for the infos! It did't fix my issue, but mine is slightly different so I opened a new issue: #2919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants