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

"Unsupported type: serial" error in Getting Started example using `infer_schema!` with SQLite #427

Closed
Zarathustra30 opened this Issue Sep 6, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@Zarathustra30

Zarathustra30 commented Sep 6, 2016

If you go through the Getting Started guide using SQLite instead of Postgres, you cannot use infer_schema! because it kicks you out with the error "Unsupported type: serial". The docs do not include "serial" among supported types, but the database was generated using diesel setup, so the fact that it is not supported is a bit odd.

Currently using nightly-2016-07-07-x86_64-pc-windows-gnu.

@sgrif

This comment has been minimized.

Member

sgrif commented Sep 6, 2016

The type is called Integer on SQLite

@sgrif

This comment has been minimized.

Member

sgrif commented Sep 6, 2016

You say the database was set up by diesel setup -- but that doesn't create any tables. Can you provide steps to reproduce? What you've described should not be possible without user migrations

@Zarathustra30

This comment has been minimized.

Zarathustra30 commented Sep 6, 2016

Ah. I did do the migration specified in Getting Started:

CREATE TABLE posts (
  id SERIAL PRIMARY KEY,
  title VARCHAR NOT NULL,
  body TEXT NOT NULL,
  published BOOLEAN NOT NULL DEFAULT 'f'
)

But now that I look at it, I see serial right there. Which I now realize needs to be an Integer.

Now that I have fixed it, I'm getting completely different error messages, which is always a good sign.

killercup added a commit to killercup/diesel.rs-website that referenced this issue Sep 9, 2016

Add note regarding raw SQL in migrations
Mentions how to make this work with SQLite.

See diesel-rs/diesel#427
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment