Skip to content

Commit

Permalink
closql--slot-table{,s}: No longer replace dashes in table names
Browse files Browse the repository at this point in the history
EmacSQL takes care of this.
  • Loading branch information
tarsius committed Jun 1, 2024
1 parent c7deeaa commit 6ba79b5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions closql.el
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,8 @@
(closql--slot-get obj slot :closql-class))

(defun closql--slot-table (obj slot)
(let ((tbl (closql--slot-get obj slot :closql-table)))
(and tbl (intern (string-replace
"-" "_"
(symbol-name (if (symbolp tbl) tbl (car tbl))))))))
(and-let* ((tbl (closql--slot-get obj slot :closql-table)))
(if (symbolp tbl) tbl (car tbl))))

(defun closql--slot-get (object-or-class slot prop)
(cdr (assq prop (closql--slot-properties object-or-class slot))))
Expand Down Expand Up @@ -613,8 +611,7 @@
(let ((tables (closql--slot-get obj slot :closql-table)))
(unless (listp tables)
(error "%s isn't an indirect slot" slot))
(list (intern (string-replace "-" "_" (symbol-name (nth 0 tables))))
(intern (string-replace "-" "_" (symbol-name (nth 1 tables)))))))
tables))

;;; Utilities

Expand Down

0 comments on commit 6ba79b5

Please sign in to comment.