mirror of
https://github.com/dimitri/pgloader.git
synced 2026-03-10 06:31:03 +01:00
Accept MySQL dbname beginning with digits, fix #230.
pgloader used to have a single database name parsing rule that is supposed to be compliant with PostgreSQL identifier rules. Of course it turns out that MySQL naming rules are different, so adjust the parser so that the following connection string is accepted: mysql://root@localhost/3scale_system_development
This commit is contained in:
parent
8e6e67f056
commit
bf62e06ff6
@ -101,10 +101,17 @@
|
||||
|
||||
(defrule mysql-prefix "mysql://" (:constant (list :type :mysql)))
|
||||
|
||||
(defrule mysql-dsn-dbname (and "/" (* (or (alpha-char-p character)
|
||||
(digit-char-p character)
|
||||
punct)))
|
||||
(:destructure (slash dbname)
|
||||
(declare (ignore slash))
|
||||
(list :dbname (text dbname))))
|
||||
|
||||
(defrule mysql-uri (and mysql-prefix
|
||||
(? dsn-user-password)
|
||||
(? dsn-hostname)
|
||||
dsn-dbname)
|
||||
mysql-dsn-dbname)
|
||||
(:lambda (uri)
|
||||
(destructuring-bind (&key type
|
||||
user
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user