mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Some more cleanup after the *pgconn* refactoring.
This commit is contained in:
parent
5b726e47a0
commit
f20d7cb452
@ -404,11 +404,7 @@
|
||||
#:*state*
|
||||
#:*csv-path-root*
|
||||
#:*root-dir*
|
||||
#:*pgconn-host*
|
||||
#:*pgconn-port*
|
||||
#:*pgconn-user*
|
||||
#:*pgconn-pass*
|
||||
#:*pg-dbname*
|
||||
#:*pgconn*
|
||||
#:*pg-settings*
|
||||
#:*myconn-host*
|
||||
#:*myconn-port*
|
||||
|
||||
@ -41,16 +41,11 @@
|
||||
(destructuring-bind (source pg-db-uri &key before commands finally) archive
|
||||
(when (and (or before finally) (null pg-db-uri))
|
||||
(error "When using a BEFORE LOAD DO or a FINALLY block, you must provide an archive level target database connection."))
|
||||
(destructuring-bind (&key host port user password dbname &allow-other-keys)
|
||||
pg-db-uri
|
||||
(destructuring-bind (&key dbname &allow-other-keys) pg-db-uri
|
||||
`(lambda ()
|
||||
(let* ((state-before (pgloader.utils:make-pgstate))
|
||||
(*state* (pgloader.utils:make-pgstate))
|
||||
(*pgconn-host* ',host)
|
||||
(*pgconn-port* ,port)
|
||||
(*pgconn-user* ,user)
|
||||
(*pgconn-pass* ,password)
|
||||
(*pg-dbname* ,dbname)
|
||||
,@(pgsql-connection-bindings pg-db-uri nil)
|
||||
(state-finally ,(when finally `(pgloader.utils:make-pgstate)))
|
||||
(archive-file
|
||||
,(destructuring-bind (kind url) source
|
||||
|
||||
@ -128,12 +128,12 @@
|
||||
;;
|
||||
;; Turn UNIQUE indexes into PRIMARY KEYS now
|
||||
;;
|
||||
(pgstate-add-table state *pg-dbname* "Primary Keys")
|
||||
(pgstate-add-table state (pgconn-dbname) "Primary Keys")
|
||||
(loop :for sql :in pkeys
|
||||
:when sql
|
||||
:do (progn
|
||||
(log-message :notice "~a" sql)
|
||||
(pgsql-execute-with-timing *pg-dbname* "Primary Keys" sql state)))
|
||||
(pgsql-execute-with-timing (pgconn-dbname) "Primary Keys" sql state)))
|
||||
|
||||
;;
|
||||
;; Foreign Key Constraints
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user