Error this query cannot be compiled to SQL
I am trying to do
anybody have an idea how to do this query?
Solution:Jump to solution
I the end I went with
``ts
await sql
.raw(
ALTER SCHEMA "${current.subdomain}" RENAME TO "${subdomain}"`)
.execute(trx)...7 Replies
Subtitutions are by default treated as values and passed as parameters. You want identifiers here. You can use
sql.id
another way is to just run a completely raw query
this still throws
also TS is not happy about this
![No description](https://cdn.answeroverflow.com/1177565620515115069/image.png)
Solution
I the end I went with
Yeah, I'm not sure
executeQuery
should even work with raw SQL. Is it even public interface?
It is
It should probably workno worries, DDL queries are quite an edgecase for most query builders
Hmm.. The function takes a
CompiledQuery
or a Compilable
. RawBuilder
(returned from sql
) shouldn't be either.
I'll take a look at this. Something funky here