-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix NamingStrategy override of querySchema #1560
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ class MetaDslMacro(val c: MacroContext) extends ValueComputation { | |
q""" | ||
new ${c.prefix}.SchemaMeta[$t] { | ||
private[this] val _entity = | ||
${c.prefix}.quote(${c.prefix}.querySchema[$t](${t.tpe.typeSymbol.name.decodedName.toString})) | ||
${c.prefix}.quote(${c.prefix}.impliedQuerySchema[$t](${t.tpe.typeSymbol.name.decodedName.toString})) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to have a separatae |
||
def entity = _entity | ||
} | ||
""" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,9 @@ private[getquill] trait QueryDsl { | |
@compileTimeOnly(NonQuotedException.message) | ||
def querySchema[T](entity: String, columns: (T => (Any, String))*): EntityQuery[T] = NonQuotedException() | ||
|
||
@compileTimeOnly(NonQuotedException.message) | ||
def impliedQuerySchema[T](entity: String, columns: (T => (Any, String))*): EntityQuery[T] = NonQuotedException() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't use |
||
|
||
implicit class NullableColumnExtensions[A](o: Option[A]) { | ||
@compileTimeOnly(NonQuotedException.message) | ||
def getOrNull: A = | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
dynamicQuerySchema
method needs to useFixed
naming strategy since it's the equivalent ofquerySchema
. Need to have a separate invocation ofEntity
here.