(defclass social-profile ()
((user :col-type user
:initarg :user
:accessor get-user)
(service :col-type (:text)
:initarg :service
:reader get-service
:inflate (lambda (text)
(make-keyword (string-upcase text))))
(:documentation "Represents a User's link to a social service.
User can be bound to multiple social services.")
(:metaclass mito:dao-table-class))
then I can do:
(mito:find-dao 'social-profile :service :github)
Mito thinks that :github is a column name and Postgres throws an error:
DB Error: column "github" does not exist (Code: 42703)
[Condition of type DBI.ERROR:<DBI-PROGRAMMING-ERROR>]
Restarts:
0: [RETRY] Retry SLY mREPL evaluation request.
1: [*ABORT] Return to SLY's top level.
2: [ABORT] abort thread (#<THREAD "sly-channel-1-mrepl-remote-1" RUNNING {1012AF06B3}>)
Backtrace:
0: ((:METHOD DBI.DRIVER:PREPARE (DBD.POSTGRES:<DBD-POSTGRES-CONNECTION> STRING)) #<DBD.POSTGRES:<DBD-POSTGRES-CONNECTION> {100E99AB73}> "SELECT * FROM \"social_profile\" WHERE (\"service\" = \"github\") ..
1: ((:METHOD MITO.DB:RETRIEVE-BY-SQL (STRING)) "SELECT * FROM \"social_profile\" WHERE (\"service\" = \"github\") LIMIT 1" :BINDS NIL) [fast-method]
2: ((SB-PCL::EMF MITO.DB:RETRIEVE-BY-SQL) #<unused argument> #<unused argument> "SELECT * FROM \"social_profile\" WHERE (\"service\" = \"github\") LIMIT 1" :BINDS NIL)
3: ((:METHOD MITO.DB:RETRIEVE-BY-SQL (SXQL.SQL-TYPE:SQL-STATEMENT)) #<SXQL-STATEMENT: SELECT * FROM "social_profile" WHERE ("service" = "github") LIMIT 1> :BINDS #<unused argument>) [fast-method]
4: ((SB-PCL::EMF MITO.DB:RETRIEVE-BY-SQL) #<unused argument> #<unused argument> #<SXQL-STATEMENT: SELECT * FROM "social_profile" WHERE ("service" = "github") LIMIT 1>)
5: (MITO.DAO::SELECT-BY-SQL #<MITO.DAO.TABLE:DAO-TABLE-CLASS WEBLOCKS-AUTH/MODELS::SOCIAL-PROFILE> #<SXQL-STATEMENT: SELECT * FROM "social_profile" WHERE ("service" = "github") LIMIT 1>)
6: (MITO.DAO:FIND-DAO #<MITO.DAO.TABLE:DAO-TABLE-CLASS WEBLOCKS-AUTH/MODELS::SOCIAL-PROFILE> :SERVICE :GITHUB)
7: (SB-INT:SIMPLE-EVAL-IN-LEXENV (MITO.DAO:FIND-DAO (QUOTE SOCIAL-PROFILE) :SERVICE :GITHUB) #<NULL-LEXENV>)
8: (EVAL (MITO.DAO:FIND-DAO (QUOTE SOCIAL-PROFILE) :SERVICE :GITHUB))
I expected Mito will apply deflate automatically, making "GITHUB" string from the :github symbol.
For example, if I have a model like that:
then I can do:
Mito thinks that
:github
is a column name and Postgres throws an error:I expected Mito will apply deflate automatically, making
"GITHUB"
string from the:github
symbol.Should this be considered a bug?