Skip to content
REFERENCE

CocoSQL

A universal SQL dialect that auto-translates to different dialects. The default way of interacting with data via SQL in Coco Alemana.

While most SQL dialects are relatively close to the ANSI specification, the supported functions and semantics often vary. So much so, that when performing work on your data you might be switch between 2-3 dialects per day. For analytics work, this is extremely tedious, and requires you to learn the intricacies of each dialect. This usually causes slowdowns, or even errors within your analysis.

Coco Alemana seeks to unify your experience working with data. We’ve created a unified way of interacting with data via SQL.

We’re not trying to create our own database engine, or our own SQL dialect. Instead, we’re making the best use of an existing dialect, DuckDB, and building a transpiler layer on-top. This means that CocoSQL should feel just like DuckDB.

CocoSQL has a sub-dialect of DuckDB. That dialect is transpiled automatically to the engine that needs it.

Coco SQL transpiles to other dialects

Not all sources shown above are currently supported by CocoSQL

The transpiler takes into account function names, parameter arguments, input types, return types, and other semantics like IEEE-compliant division. We handle other things like position offsets, null handling, casting, etc.

We have a hybrid execution model which keeps the interface fast. We’re able to re-use cached results locally, and even have pre-fetching available. Pre-fetching allows us to speed up queries potentially by 1000x, as we can know the result before executing the query. Similar to how your CPU pre-fetching values.

For SQL reference, please see DuckDB Documentation.