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

Allowing `integer` to map to i64 for sqlite #1116

Closed
Boscop opened this Issue Aug 17, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@Boscop

Boscop commented Aug 17, 2017

When I use id integer not null primary key autoincrement in sqlite, I have to use i32 in Rust but I want to have i64 because I have a lot of records, but when I write id bigint not null primary key autoincrement I get:

error: AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY

This is a syntactic limitation of sqlite but sqlite stores all integers as arbitrary precision anyway, so it would be possible for diesel to also allow mapping integer to i64.
It would be very useful!

Also, it doesn't let me use u64 for size_bytes unsigned bigint not null, only i64...

@killercup killercup added the sqlite label Aug 18, 2017

@sgrif

This comment has been minimized.

Member

sgrif commented Aug 19, 2017

This has been raised before, and we decided to keep things as they are for reasons I laid out in #852 (comment). If you need i64 keys, you can use table! or diesel print-schema and specify that the id column is of type BigInt there, but I don't think we should change the behavior of schema inference for the reasons I laid out in the previous comment.

@sgrif sgrif closed this Aug 19, 2017

@yipdw yipdw referenced this issue Jan 14, 2018

Open

Add SQLite backend #12

7 of 9 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment