mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 07:56:01 +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 }) {
|
||||
const client = new pg.Client({
|
||||
// connectionString: 'postgres://root@localhost:26257/postgres?sslmode=disabke'
|
||||
host: server,
|
||||
port,
|
||||
user,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module.exports = `
|
||||
with pkey as
|
||||
(
|
||||
select cc.conrelid, format(E'create constraint %I primary key(%s);\\n', cc.conname,
|
||||
string_agg(a.attname, ', '
|
||||
order by array_position(cc.conkey, a.attnum))) pkey
|
||||
select cc.conrelid, 'create constraint ' || cc.conname || ' primary key(' ||
|
||||
string_agg(a.attname, ', ' order by array_position(cc.conkey, a.attnum)) || ');\\n'
|
||||
pkey
|
||||
from pg_catalog.pg_constraint cc
|
||||
join pg_catalog.pg_class c on c.oid = cc.conrelid
|
||||
join pg_catalog.pg_attribute a on a.attrelid = cc.conrelid
|
||||
|
||||
Reference in New Issue
Block a user