Pikbase Docs
Open console (opens the console)
Esc

Type to search.

Build

Data tables, policies, and search

Build definition-driven tables with query-backed access policies and multilingual full-text search.

Contract sourcePikbase docs

Pikbase keeps the table, query, and access model on the same entity contract. A client can render columns and filters from an entity definition, but Entity Service remains responsible for enforcing access on every query and save.

Definition-driven data tables

Entity definitions describe properties, relationships, searchable fields, and presentation metadata. The shared data table turns those definitions into columns, type-aware filters, server sorting, pagination, relation selectors, and saved query views. The browser does not become the authority for access merely because it renders the table.

Row and operation policies

A permission policy can target users, roles, groups, positions, or departments and carry an operation mask for read, create, delete, edit, query, and execute. Its queryStr expresses the record condition applied by the backend, enabling row-level policies based on the same query model used by Entity Service. Priority, query count limits, paging rules, and nested-only behavior further bound permitted access.

Column policies

Entity definitions can set base propertyPermissions for all properties. An individual property can supply its own permissions to override that default. This provides field-level control for sensitive columns while leaving explicitly permitted fields available. Enforcement belongs to the backend data operation; hiding a column in the table is presentation, not authorization.

Key-based upserts

Save can identify an existing entity without its generated id. A definition may mark more than one property as a primary key. Supplying any configured primary key, such as an existing GsbUser.email, updates the matching row instead of inserting a duplicate.

Properties marked isPartialPrimaryKey work as one composite identifier. Supply every partial-key property in the save payload; when the complete combination exists, Entity Service updates that row, and when it does not, Entity Service creates one. An incomplete partial-key set is not an identity match.

Partial-primary-key matching through a reference property or its *_id companion is not yet a published guarantee. Use a generated ID or verified scalar key fields for that case until its reference-field behavior is contract-tested.

Atomic calculated saves

Set a property to _CALC(expression) to calculate its new value from the row currently stored by Entity Service. Direct properties on that row use references such as [viewCount]; _CALC([viewCount] + 1) increments the counter inside the save transaction instead of reading it into the application and writing it back later.

Numeric literals are supported, including integers and decimals. Combine them with direct row properties, arithmetic, comparisons, parentheses, and supported functions: _CALC([totalCount] + 1) is the simple case, while _CALC([_ROUND](([_COALESCE]([subtotal], 0) + [_COALESCE]([shipping], 0)) * 1.20 - [_ABS]([discount]), 2)) composes several fields and operations. Expression complexity is not artificially limited, but every property, token, and character must belong to the allowlists below.

For a key-based upsert, append a create fallback after a colon. _CALC([_COALESCE]([balance], 0) + 25) : 25 increments the matching row by 25, or initializes balance to 25 when the key combination creates a row.

Reference direct properties on the saved row as [propertyName]. The supported expression tokens are:

Group Supported tokens
Null and conditions NULL, CASE, WHEN, THEN, ELSE, END, COALESCE, NULLIF, IS, NOT, AND, OR
Numeric ABS, ROUND, CEILING, FLOOR, POWER, SQRT, EXP, LOG
Text LEN, LENGTH, LTRIM, RTRIM, SUBSTRING, SUBSTR, UPPER, LOWER, REPLACE, CONCAT
Aggregate COUNT, SUM, AVG, MIN, MAX

Inside an expression, write a supported token in bracketed underscore form, such as [_COALESCE], [_ROUND], or [_CASE] ... [_WHEN] ... [_THEN] ... [_ELSE] ... [_END]. This is an allowlist, not arbitrary SQL execution.

Outside recognized bracketed property and operator names, expressions allow only digits, spaces, and +-*/.,():?\ <>=. Apostrophes are not allowed, so quoted string literals and static string concatenation are not currently supported. Text operations such as CONCAT, REPLACE, UPPER, and LOWER work with referenced string properties, for example [_CONCAT]([firstName], [lastName]). Store fixed text in a property or calculate it outside _CALC instead of embedding a quoted literal.

The token is _CALC with one leading underscore, not __CALC. Validate and convert interpolated values to their expected primitive types; never concatenate untrusted text into a calculation expression. See the save operation reference for examples and transaction behavior.

Mark a property searchable, multilingual, and full-text indexed in its definition. Entity Service supports configured searchText search plus FullTextSearch and PhraseSearch query operators. Requests carry the active langCode, so multilingual property values are read and searched in the caller's language context.

Combine these controls with nested filters, includes, sorting, pagination, and selected columns through QueryParams.