Merge pull request #343 from sosedoff/list-constraint-name
Include constraint name under "constraints" tab
This commit is contained in:
commit
121f278713
@ -1,4 +1,6 @@
|
|||||||
sudo: required
|
sudo: required
|
||||||
|
dist: trusty
|
||||||
|
group: deprecated-2017Q4
|
||||||
|
|
||||||
language: go
|
language: go
|
||||||
|
|
||||||
|
@ -266,8 +266,9 @@ func test_TableConstraints(t *testing.T) {
|
|||||||
res, err := testClient.TableConstraints("editions")
|
res, err := testClient.TableConstraints("editions")
|
||||||
|
|
||||||
assert.Equal(t, nil, err)
|
assert.Equal(t, nil, err)
|
||||||
assert.Equal(t, 1, len(res.Columns))
|
assert.Equal(t, []string{"name", "definition"}, res.Columns)
|
||||||
assert.Equal(t, 2, len(res.Rows))
|
assert.Equal(t, Row{"pkey", "PRIMARY KEY (isbn)"}, res.Rows[0])
|
||||||
|
assert.Equal(t, Row{"integrity", "CHECK (book_id IS NOT NULL AND edition IS NOT NULL)"}, res.Rows[1])
|
||||||
}
|
}
|
||||||
|
|
||||||
func test_Query(t *testing.T) {
|
func test_Query(t *testing.T) {
|
||||||
|
@ -50,7 +50,8 @@ WHERE
|
|||||||
|
|
||||||
TableConstraints = `
|
TableConstraints = `
|
||||||
SELECT
|
SELECT
|
||||||
pg_get_constraintdef(c.oid, true) as condef
|
conname as name,
|
||||||
|
pg_get_constraintdef(c.oid, true) as definition
|
||||||
FROM
|
FROM
|
||||||
pg_constraint c
|
pg_constraint c
|
||||||
JOIN
|
JOIN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user