This feature may change in backward incompatible ways. The translator may not handle all source syntax. Translations may be invalid syntax. Translations may be valid syntax but semantically incorrect with unknown and unintended consequences. Semantics are not the same across SQL platforms even for identical syntax.
If you're more familiar with a SQL syntax other than PostgreSQL's or you just imported data from another database onto bit.io and have pre-existing queries in another syntax, you can try out bit.io's SQL syntax translator.
For example, if you just imported a SQLite database via our auto-importer that has the table
foo, you can query that table using SQLite syntax:
#!translate:sqlite select * from [foo]
To use the translator, start your query string with one of the following first lines (in order of recommendation):
--!translate:[source](do not use this with
psql, it strips
[source] is one of the following supported syntaxes:
prql sql_dialect:postgreson the next line per PRQL docs)
On every subsequent line, write SQL in that source's syntax. When bit.io receives the query, it will attempt to translate it into PostgreSQL. Note that the first line will be removed. Do not put any other commands on the first line.
If query translation fails, the original query will still be submitted. Be careful! The
#!directive should cause an error whereas others will not fail from the directive alone because the directives are comment characters. Be careful when using comment characters.
One source directive per query string. Subsequent directives in a single query are ignored.
Translation adds ~3-50ms latency, depending on query complexity and translator
Functions may not have the same semantics or exist in Postgres. Function names are not always translated.
Updated about 1 month ago