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

allow to use _rowid_ as normal field #418

Open
zoff99 opened this issue Jun 1, 2017 · 3 comments
Open

allow to use _rowid_ as normal field #418

zoff99 opened this issue Jun 1, 2017 · 3 comments

Comments

@zoff99
Copy link
Contributor

zoff99 commented Jun 1, 2017

is there a way to select "rowid" just like any other field of a table?

orma.selectFromTable()._rowid_Eq(myrowid)....

or update with rowid

orma.updateTablex()._rowid_Eq(myrowid)....

@gfx
Copy link
Member

gfx commented Jun 1, 2017

It's possible if you declare the field.

@zoff99
Copy link
Contributor Author

zoff99 commented Jun 1, 2017

how can i declare rowid? this is already sqlite internal

@gfx
Copy link
Member

gfx commented Jun 1, 2017

Just declare @PrimaryKey long <your favorite name> which is an alias to _rowid_.

https://sqlite.org/autoinc.html

If a table contains a column of type INTEGER PRIMARY KEY, then that column becomes an alias for the ROWID.

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

2 participants