Electron100 / butane

An ORM for Rust with a focus on simplicity and on writing Rust, not SQL
Apache License 2.0
94 stars 13 forks source link

rowid #169

Open jayvdb opened 10 months ago

jayvdb commented 10 months ago

sqlite: https://www.sqlite.org/rowidtable.html "rowid" pg: https://www.postgresql.org/docs/current/ddl-system-columns.html "ctid" oracle: https://stackoverflow.com/questions/2701782/rowid-oracle-any-use-for-it "rowid"

If we dont have any use for rowid, we could amend the sqlite DDL to use "without rowid", supported since 3.8.2 (2013-12-06) for the main tables. We can also do this on the Many tables if we add a better constraint on them.

How could we use it? It could be used as a "order by" column for stable ordering of query results. It could be used internally to perform DML on rows, as rowid is quicker than primary keys.

It shouldnt be stored in the database, so it cant be used instead of a primary key, only in addition to primary keys.