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
|
||||
dist: trusty
|
||||
group: deprecated-2017Q4
|
||||
|
||||
language: go
|
||||
|
||||
|
@ -266,8 +266,9 @@ func test_TableConstraints(t *testing.T) {
|
||||
res, err := testClient.TableConstraints("editions")
|
||||
|
||||
assert.Equal(t, nil, err)
|
||||
assert.Equal(t, 1, len(res.Columns))
|
||||
assert.Equal(t, 2, len(res.Rows))
|
||||
assert.Equal(t, []string{"name", "definition"}, res.Columns)
|
||||
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) {
|
||||
|
@ -50,7 +50,8 @@ WHERE
|
||||
|
||||
TableConstraints = `
|
||||
SELECT
|
||||
pg_get_constraintdef(c.oid, true) as condef
|
||||
conname as name,
|
||||
pg_get_constraintdef(c.oid, true) as definition
|
||||
FROM
|
||||
pg_constraint c
|
||||
JOIN
|
||||
|
Loading…
x
Reference in New Issue
Block a user