doc: add entries for new 'rowid' related sqlite lint checks
This commit is contained in:
parent
2df2c634cd
commit
ec19c3dcb5
@ -47,11 +47,31 @@ Enforce that all columns should use `integer` type instead of `int`.
|
|||||||
|
|
||||||
### `require_explicit_primary_key`
|
### `require_explicit_primary_key`
|
||||||
|
|
||||||
Enforce that all tables must have a primary key. If the primary key is `rowid`, it must be declared explicitly.
|
Enforce that all tables must have an explicitly declared primary key.
|
||||||
|
|
||||||
**Explanation**:
|
**Explanation**:
|
||||||
|
|
||||||
- All tables need to have a primary key, and it should usually be `rowid`. Declaring it explicitly improves the readability of the schema.
|
- All tables need to have a primary key for storage reasons, so if you don't declare one, SQLite will auto-generate a hidden "rowid" column. Making it explicit (rowid or otherwise) improves schema readability.
|
||||||
|
|
||||||
|
See more about the special behavior of `rowid` in SQLite's documentation: <https://sqlite.org/lang_createtable.html#rowid>
|
||||||
|
|
||||||
|
### `require_explicit_rowid`
|
||||||
|
|
||||||
|
Enforce that any table that's not declared `without rowid` has an explicit `rowid integer primary key` column.
|
||||||
|
|
||||||
|
**Explanation**:
|
||||||
|
|
||||||
|
- In SQLite, all tables implicitly have a `rowid` column unless they are declared `without rowid`. Making it explicit improves schema readability.
|
||||||
|
|
||||||
|
See more about the `without rowid` modifier in SQLite's documentation: <https://sqlite.org/withoutrowid.html>
|
||||||
|
|
||||||
|
### `forbid_rowid_on_without_rowid_table`
|
||||||
|
|
||||||
|
Enforce that `without rowid` tables don't have a rowid column.
|
||||||
|
|
||||||
|
**Explanation**:
|
||||||
|
|
||||||
|
- This is pretty self explanatory. You can technically give a `without rowid` table a rowid column. But don't.
|
||||||
|
|
||||||
### `require_indexes_for_foreign_keys`
|
### `require_indexes_for_foreign_keys`
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user