You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current situation
In dynamic where block, comma means AND:
sql db {
dynamic update User set name = 'new' where {
id == user_id,
tenant_id == tenant_id
}
}
// WHERE id = ? AND tenant_id = ?
Problem
No way to write OR directly:
// ❌ Doesn't work
sql db {
dynamic update User set name = 'new' where {
id == user_id || tenant_id == tenant_id
}
}
Use Case
Support || or or in dynamic where block:
up_expr := {
if status := req.status { status == status },
if name := req.name { name == name },
updated_at == time.now()
}
sql db {
dynamic update User set up_expr where {
id == user_id || tenant_id == tenant_id
}
}
// WHERE id = ? OR tenant_id = ?
Describe the feature
Current situation
In dynamic where block, comma means AND:
Problem
No way to write OR directly:
Use Case
Support || or or in dynamic where block:
Proposed Solution
No response
Other Information
No response
Acknowledgements
Version used
V 0.5.1 a2be374
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.