(defclass lispy-name-tweet ()
((id :type integer
:primary-key t
:auto-increment t
:reader tweet-id)
(status :type text
:initarg :status
:accessor tweet-status)
(user :type (varchar 32)
:initarg :user
:accessor tweet-user))
(:metaclass integral:<dao-table-class>))
(integral:ensure-table-exists 'lispy-name-tweet)
(let ((tw (make-instance 'lispy-name-tweet
:status "Good morning, world."
:user "nitro_idiot")))
(integral:save-dao tw))
sqlite => DB Error: near "-": syntax error (Code: ERROR)
[Condition of type DBI.ERROR:<DBI-PROGRAMMING-ERROR>]
mysql => DB Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-name-tweet ORDER BY id DESC LIMIT 1' at line 1 (Code: 1064)
[Condition of type DBI.ERROR:<DBI-PROGRAMMING-ERROR>]
The generated query is:
sqlite => "SELECT id AS last_insert_id FROM lispy-name-tweet ORDER BY id LIMIT 1"
mysql => "SELECT id AS last_insert_id FROM lispy-name-tweet ORDER BY id DESC LIMIT 1"
This works
This does not work
The generated query is:
sqlite => "SELECT id AS last_insert_id FROM lispy-name-tweet ORDER BY id LIMIT 1" mysql => "SELECT id AS last_insert_id FROM lispy-name-tweet ORDER BY id DESC LIMIT 1"