-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from k1LoW/parse-check-constraints
Support SQLite CHECK constraints
- Loading branch information
Showing
9 changed files
with
189 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# check_constraints | ||
|
||
## Description | ||
|
||
|
||
<details> | ||
<summary><strong>Table Definition</strong></summary> | ||
|
||
```sql | ||
CREATE TABLE check_constraints ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
col TEXT CHECK(length(col) > 4), | ||
brackets TEXT UNIQUE NOT NULL CHECK(((length(brackets) > 4))), | ||
checkcheck TEXT UNIQUE NOT NULL CHECK(length(checkcheck) > 4), | ||
downcase TEXT UNIQUE NOT NULL check(length(downcase) > 4), | ||
nl TEXT UNIQUE NOT | ||
NULL check(length(nl) > 4 OR | ||
nl != 'ln') | ||
) | ||
``` | ||
|
||
</details> | ||
|
||
|
||
## Columns | ||
|
||
| Name | Type | Default | Nullable | Children | Parents | Comment | | ||
| ---- | ---- | ------- | -------- | -------- | ------- | ------- | | ||
| id | INTEGER | | true | | | | | ||
| col | TEXT | | true | | | | | ||
| brackets | TEXT | | false | | | | | ||
| checkcheck | TEXT | | false | | | | | ||
| downcase | TEXT | | false | | | | | ||
| nl | TEXT | | false | | | | | ||
|
||
## Constraints | ||
|
||
| Name | Type | Definition | | ||
| ---- | ---- | ---------- | | ||
| id | PRIMARY KEY | PRIMARY KEY (id) | | ||
| sqlite_autoindex_check_constraints_4 | UNIQUE | UNIQUE (nl) | | ||
| sqlite_autoindex_check_constraints_3 | UNIQUE | UNIQUE (downcase) | | ||
| sqlite_autoindex_check_constraints_2 | UNIQUE | UNIQUE (checkcheck) | | ||
| sqlite_autoindex_check_constraints_1 | UNIQUE | UNIQUE (brackets) | | ||
| - | CHECK | CHECK(length(col) > 4) | | ||
| - | CHECK | CHECK(((length(brackets) > 4))) | | ||
| - | CHECK | CHECK(length(checkcheck) > 4) | | ||
| - | CHECK | check(length(downcase) > 4) | | ||
| - | CHECK | check(length(nl) > 4 OR nl != 'ln') | | ||
|
||
## Indexes | ||
|
||
| Name | Definition | | ||
| ---- | ---------- | | ||
| sqlite_autoindex_check_constraints_4 | UNIQUE (nl) | | ||
| sqlite_autoindex_check_constraints_3 | UNIQUE (downcase) | | ||
| sqlite_autoindex_check_constraints_2 | UNIQUE (checkcheck) | | ||
| sqlite_autoindex_check_constraints_1 | UNIQUE (brackets) | | ||
|
||
|
||
|
||
## Relations | ||
|
||
![er](check_constraints.png) | ||
|
||
--- | ||
|
||
> Generated by [tbls](https://github.com/k1LoW/tbls) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters