Skip to content

codegen: Fix SQLite integer and primary key generation#2583

Closed
Huliiiiii wants to merge 5 commits into
SeaQL:masterfrom
Huliiiiii:sqlite-int
Closed

codegen: Fix SQLite integer and primary key generation#2583
Huliiiiii wants to merge 5 commits into
SeaQL:masterfrom
Huliiiiii:sqlite-int

Conversation

@Huliiiiii
Copy link
Copy Markdown
Member

@Huliiiiii Huliiiiii commented Apr 27, 2025

PR Info

  • Dependencies:
  • Dependents:

New Features

Bug Fixes

Breaking Changes

Changes

  • If database backend is sqlite, interger will be generated as i64 instead of i32
  • Fix sqlite primary key generated as Option

@Huliiiiii Huliiiiii changed the title codegen: Generate sqlite integer as i64 codegen: Fix SQLite integer and primary key generation Apr 27, 2025
@tyt2y3
Copy link
Copy Markdown
Member

tyt2y3 commented Apr 27, 2025

thank you. I'd like to have an option to choose whether to map it to i32/i64.
another thing we can do (in sea-schema) is to recognize bigint as a special type, and return BigInt, similar to how SmallInt is handled now.

1 similar comment
@tyt2y3
Copy link
Copy Markdown
Member

tyt2y3 commented Apr 27, 2025

thank you. I'd like to have an option to choose whether to map it to i32/i64.
another thing we can do (in sea-schema) is to recognize bigint as a special type, and return BigInt, similar to how SmallInt is handled now.

@tyt2y3
Copy link
Copy Markdown
Member

tyt2y3 commented Nov 9, 2025

I've added option to sea-orm-cli here dc8fe65

I actually like the pk fix in sea-schema better!

@tyt2y3 tyt2y3 closed this Nov 9, 2025
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

Successfully merging this pull request may close these issues.

Sqlite integer is mapped to i32 sea-orm-cli generates uncompilable model from pre-existing autoincrement primary key in sqlite

2 participants