Add support for MySQL geometry points.

The new version of the sakila database uses geometry typed columns that
contain POINT data. Add support for that kind of data by copying what we did
already for POINT datatype.
This commit is contained in:
Dimitri Fontaine 2017-02-25 21:52:41 +01:00
parent 9e2b95d9b7
commit 8ec2ea04db
2 changed files with 7 additions and 2 deletions

View File

@ -135,6 +135,10 @@
:using pgloader.transforms::set-to-enum-array)
;; geometric data types, just POINT for now
(:source (:type "geometry")
:target (:type "point")
:using pgloader.transforms::convert-mysql-point)
(:source (:type "point")
:target (:type "point")
:using pgloader.transforms::convert-mysql-point))

View File

@ -398,8 +398,9 @@ order by table_name, ordinal_position"
Mostly we just use the name, but in case of POINT we need to use
astext(name)."
(case (intern (string-upcase type) "KEYWORD")
(:point (format nil "astext(`~a`) as `~a`" name name))
(t (format nil "`~a`" name))))
(:geometry (format nil "astext(`~a`) as `~a`" name name))
(:point (format nil "astext(`~a`) as `~a`" name name))
(t (format nil "`~a`" name))))
(defun get-column-list (dbname table-name)
"Some MySQL datatypes have a meaningless default output representation, we