fukamachi / mito

An ORM for Common Lisp with migrations, relationships and PostgreSQL support
292 stars 31 forks source link

Multiple Qualifiers for Data Types Not Working as Expected #148

Open daninus14 opened 3 months ago

daninus14 commented 3 months ago

See https://github.com/fukamachi/mito/pull/147

To keep with the style of other places where qualifiers are provided, like in:

(name :col-type (:varchar 64))

It makes sense to allow parsing of multiple qualifiers like this:

(price :col-type (:numeric 10 2))

Or maybe even like this:

(price :col-type (:numeric (10 2)))

I personally prefer the first version.

There's no need for mito to deal with the data types themselves. Probably this is just a matter of checking if there are more items in the list of the :col-type and then just passing them to SQL as a comma separated list.

daninus14 commented 3 months ago

For reference see in the new docs: https://github.com/fukamachi/mito/pull/147/files#diff-752180eb8dc62c50aabe89619582363f65cb62ee49284c846d82ed7fe156cd1bR227

The SQL statement for the example above would be

"price numeric(10,2) NOT NULL,