CRUD over an existing table
The problem
A database table — products, tickets, contracts — and a team that needs to read and edit it, without writing a front end.
The pattern
table → connector with 4 generated queries → screen → menu entry
The recipe
1. Reach the database
Liberty Next → Administer → Pools: the default pool works when the table is in the framework's database; otherwise add a pool with the database's URL. See Connectors.
2. Generate the queries
Liberty Next → Build → Connectors: create (or pick) the SQL connector, choose the Tables view, then + Add queries → Generate from DB. Pick the products table, keep the columns to show, tick key on ID, keep the four statements and save. The wizard writes:
-- products_get
SELECT ID, NAME, PRICE, STOCK FROM products
-- products_post
INSERT INTO products (ID, NAME, PRICE, STOCK) VALUES (:ID, :NAME, :PRICE, :STOCK)
-- products_put
UPDATE products SET NAME = :NAME, PRICE = :PRICE, STOCK = :STOCK WHERE ID = :ID_ORIGINAL
-- products_delete
DELETE FROM products WHERE ID = :ID
To stamp who changed a row and when, add the audit columns to the write queries with server tokens — the browser cannot alter them:
UPDATE products
SET NAME = :NAME, PRICE = :PRICE, STOCK = :STOCK,
UPDATED_BY = {{LOGIN}}, UPDATED_AT = {{SYSTIMESTAMP}}
WHERE ID = :ID_ORIGINAL
Or give the UPDATED_BY / UPDATED_AT dictionary entries the LOGIN / SYSDATE rules. See Parameter binding → Tokens.
3. Build the screen
Liberty Next → Build → Screens, the connector's chip (+ Add scope the first time), + Add screen products, then in the screen editor:
| Tab | Setting |
|---|---|
| General | Label Products; Editable for in-grid editing; uploadable for Excel / CSV import. |
| Queries | Read products_get, update products_put, insert products_post, delete products_delete. |
| Columns | Labels, formats, widths, filters. |
| Dialog | Drag the columns onto the form. |
The Screen Creation Assistant does steps 2 and 3 in one pass.
4. Add the menu entry
Liberty Next → Build → Menus, the connector's chip (+ Add scope the first time), + Item: label Products, type screen, target products_get. Save.
Result
Clicking Products opens the grid: sort and filter by column, group, save views; a row opens the edit dialog, + Add an empty one, Delete removes the row. Each query has its own permission — sql:<connector>:products_get, sql:<connector>:products_put… — to grant through roles.
Variations
| Need | How |
|---|---|
| Labels and lists of values | Dictionary entries on the columns, with an ENUM or LOOKUP rule — see Dictionary. |
| Read-only for some users | Give their role only the read query's permission: writes are refused. To make the screen read-only for everyone, tick Read-only on the General tab. |
| Excel export | The screen's Export tab — see Excel export. |
| Related rows inside the dialog | A nested_table tab — see Nested tabs. |
| Bulk loading from a file | See Bulk import. |
What's next
- Create from a database table — the CRUD wizard in detail.
- Screens — every screen setting.
- Roles & permissions — who sees and edits what.