mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 18:03:58 +00:00
#112 fix for CockroachDB
This commit is contained in:
@@ -99,6 +99,7 @@ const driver = {
|
|||||||
|
|
||||||
async connect({ server, port, user, password, database, ssl }) {
|
async connect({ server, port, user, password, database, ssl }) {
|
||||||
const client = new pg.Client({
|
const client = new pg.Client({
|
||||||
|
// connectionString: 'postgres://root@localhost:26257/postgres?sslmode=disabke'
|
||||||
host: server,
|
host: server,
|
||||||
port,
|
port,
|
||||||
user,
|
user,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
module.exports = `
|
module.exports = `
|
||||||
with pkey as
|
with pkey as
|
||||||
(
|
(
|
||||||
select cc.conrelid, format(E'create constraint %I primary key(%s);\\n', cc.conname,
|
select cc.conrelid, 'create constraint ' || cc.conname || ' primary key(' ||
|
||||||
string_agg(a.attname, ', '
|
string_agg(a.attname, ', ' order by array_position(cc.conkey, a.attnum)) || ');\\n'
|
||||||
order by array_position(cc.conkey, a.attnum))) pkey
|
pkey
|
||||||
from pg_catalog.pg_constraint cc
|
from pg_catalog.pg_constraint cc
|
||||||
join pg_catalog.pg_class c on c.oid = cc.conrelid
|
join pg_catalog.pg_class c on c.oid = cc.conrelid
|
||||||
join pg_catalog.pg_attribute a on a.attrelid = cc.conrelid
|
join pg_catalog.pg_attribute a on a.attrelid = cc.conrelid
|
||||||
|
|||||||
Reference in New Issue
Block a user