Vex · Query DSLSelect and alias (
Select and alias (fields)
from lists the tables of a query and fields lists each selected column as table.column. There is no SELECT *. A field written as { field, as } is returned under the alias given in as.
{
from: ['shows'],
fields: ['shows.night', { field: 'shows.title', as: 'plays' }],
}CREATE TABLE shows (night text PRIMARY KEY, title text NOT NULL)
SELECT s1.night AS "night", s1.title AS "plays" FROM shows AS s1 LIMIT 100
Runs in this page on the installed package. The input and the expected output are defined by the example.