MCPcopy Create free account
hub / github.com/ariga/atlas / TestSQLSpec

Function TestSQLSpec

sql/sqlite/sqlspec_test.go:16–188  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestSQLSpec(t *testing.T) {
17 f := `
18schema "schema" {
19}
20
21table "table" {
22 schema = schema.schema
23 column "id" {
24 type = integer
25 auto_increment = true
26 }
27 column "age" {
28 type = integer
29 }
30 column "price" {
31 type = integer
32 }
33 column "account_name" {
34 type = varchar(32)
35 }
36 primary_key {
37 columns = [table.table.column.id]
38 }
39 index "index" {
40 unique = true
41 columns = [
42 table.table.column.id,
43 table.table.column.age,
44 ]
45 where = "age <> 0"
46 }
47 foreign_key "accounts" {
48 columns = [
49 table.table.column.account_name,
50 ]
51 ref_columns = [
52 table.accounts.column.name,
53 ]
54 on_delete = SET_NULL
55 }
56 check "positive price" {
57 expr = "price > 0"
58 }
59 without_rowid = true
60 strict = false
61}
62
63table "accounts" {
64 schema = schema.schema
65 column "name" {
66 type = varchar(32)
67 }
68 primary_key {
69 columns = [table.accounts.column.name]
70 }
71 strict = true
72}
73`

Callers

nothing calls this directly

Calls 3

NewRealmFunction · 0.92
NewFunction · 0.92
AddIndexesMethod · 0.45

Tested by

no test coverage detected