sqlc-dev / sqlc

Generate type-safe code from SQL
https://sqlc.dev
MIT License
13.54k stars 809 forks source link

specifying correct type in MySQL #3700

Open omid9h opened 2 weeks ago

omid9h commented 2 weeks ago

Version

1.27.0

What happened?

in this playground I have a where clause like:

AND (sqlc.arg(deleted_at) = true OR `users`.`deleted_at` IS NULL)
AND (sqlc.arg(first_name) = "" OR aes_decrypt(from_base64(first_name), sqlc.arg(aes_key)) LIKE CONCAT('%', sqlc.arg(first_name), '%'))
AND (sqlc.arg(last_name) = "" OR aes_decrypt(from_base64(last_name), sqlc.arg(aes_key)) LIKE CONCAT('%', sqlc.arg(last_name), '%'))

and I expect deleted_at to infer as bool and first_name, last_name, and phone as string but the output for all of them is interface{}. any idea how to fix this?

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

https://play.sqlc.dev/p/beeafdcaa14bcb7ff7afd0ddf6a204b787f831155deb4fbc5c9502f76021c88b

What operating system are you using?

Linux

What database engines are you using?

MySQL

What type of code are you generating?

Go