Skip to main content

Queries — overview

A query in Liberty is a named SQL statement attached to a connector (which itself points at a pool, i.e. a database). Screens, dashboards, charts, dictionary lookups, dictionary sequences and the AI assistant all consume queries — so adding a query is the most common change you'll make in the Liberty Next pages.

The page that manages queries is Liberty Next → Build → Connectors. This overview maps it; the next pages walk through each "add" path.


The Connectors page at a glance​

Settings · Connectors+ ConnectorDiscardSaveAPPS▣ crm▣ nomajde▣ nomasx1DATA SOURCES⛁ default⛁ jdedwards⛁ reporting[connectors.crm] · sqlSettingsTablesQueriesSequencesLookups+ Add queriescustomersPortfolio customersGETPUTPOSDELdealsOpen dealsGETPUTPOSDELactivitiesNotes and callsGETPUTPOSDEL

Three regions:

RegionWhat it carries
Top toolbarGlobal actions — + Connector, Discard, Save. The Save button writes the connector file and triggers a hot reload — no process restart needed.
Left navigationTwo groups: Apps (connectors that have a menu — these are the apps users see in the top switcher) and Data sources (connectors that supply data but don't appear in the switcher). Click a name to open it on the right.
Right paneThe editor for the selected connector. A mode bar across the top picks one of five views — Settings…, Tables, Queries, Sequences, Lookups.

The four kinds of queries​

A connector keeps its queries in four sections; the section a query sits in is its kind:

ViewWhat lives here
TablesOne entry per table, holding up to four queries: get (read), post (insert), put (update), delete. They are called <table>_get, <table>_post, <table>_put, <table>_delete. The list shows a row per table with its slot badges (GET / PUT / POS / DEL).
QueriesStandalone queries outside a table's set — reports, bulk operations, queries called by actions, charts or dashboards. Example: monthly_revenue, purge_old_logs.
SequencesQueries that return the next number for a dictionary sequence. Typical body: SELECT COALESCE(MAX(<col>), 0) + 1 FROM <table>.
LookupsQueries that return codes and labels for a dictionary lookup. Typical body: SELECT <value>, <label> FROM <table>.

Change type moves a query to another section — for example a query written under Queries that turns out to feed a lookup. When the move changes the query's name (a table slot becomes a standalone query, or the reverse), a warning lists the new name: screens, actions and dictionary entries that use the old name have to be updated.


The add buttons — one per view​

ViewButtonWhat opens
Tables+ Add queriesA choice: Generate from DB (the CRUD wizard — reads the table in the database and generates the four queries) or Empty stub (asks for a table name and creates an empty read query).
Queries+ Add queryA name prompt, then an empty query to fill in by hand.
Sequences+ Add sequenceThe scaffold — pick a table and a key column, see the SQL, save: it writes the query and the dictionary sequence.
Lookups+ Add lookupThe scaffold — pick a table, a value column, a label column and an optional filter, save: it writes the query and the dictionary lookup.

The next pages walk through each path.


What a query carries​

The query editor shows these fields:

FieldRequiredWhat it does
NameYesUnique inside the connector. The query's permission is sql:<connector>:<name>. Changed with Rename, which updates every reference.
SQLYesThe statement, with :name parameters. A single text, or one variant per database (default required) — see Per-dialect SQL.
WritableNo (off)Off, only a SELECT is accepted. On for INSERT / UPDATE / DELETE / CALL.
ParamsNoDeclared parameters (name, label, default) — a label and a default value for each :name.
LabelNoShort name shown in lists.
DescriptionNoWhat the query returns — shown under the table name in the Tables list.

Save and reload — what a click does​

Saving on this page is atomic across two files when needed:

Action you tookWhat gets written
Created or edited a table or a queryThe connector file.
Used the scaffold for a sequence or a lookupThe connector file and the dictionary (the new sequence or lookup in the connector's scope).
Cloned a connector (whole app)A cross-file write that copies the dictionary overlay, screens, menu, charts and dashboards under the new name. Goes through a dedicated endpoint.
Renamed a connector, a query or a tableA cross-file update that touches every reference (screens, menus, dictionary, charts, dashboards). Refuses to run when local edits aren't saved.

After every save the framework runs a hot reload automatically. The new query is callable immediately — no restart, no logout.


What you actually do — quick map​

GoalRead
Generate the four CRUD queries from a real database table.Create from a database table — the wizard path, recommended when the table exists.
Write a custom query (standalone, hand-written).Create a custom query.
Make a copy of an existing query or of a whole application.Clone a query or a connector.
Add a sequence (next id) or a lookup (dropdown source).Sequences and lookups.
Pass values to a query — fixed values, other columns, the signed-in user.Parameter binding.
Ship different SQL for Postgres vs Oracle.Per-dialect SQL variants.

What's next​