Skip to content

EN Reference Data Models

Cavanshirpro edited this page Sep 19, 2026 · 1 revision

Data models: SQL, MongoDB and resources

English · Türkçe · Languages / Diller

Scope: JSON API Forge 0.5.1 · Source review: 17 September 2026 · Language: English

These tables were generated from the Pydantic models and JSON Schema at the pinned commit. Usage guides: CRUD, databases, MongoDB.

“Required” means the field must be present in JSON; acceptance of null is a separate type rule. A Model() default creates that model using its documented defaults. Empty lists/objects are created separately for each instance. — means no default or no constraint for that column.

Cross-field validators apply in addition to the table: permission/public selection, URL/host safety, tenant/owner columns, cache/idempotency/transaction combinations, schema collisions and safe regex. JSON Schema validation alone does not replace forge validate. Unknown fields are rejected through extra="forbid".

DatabaseConfig

Field Type Required Default Schema constraints
url string Yes — —
echo boolean No false —
support_schema_mode enum ["create","validate"] No "create" —
pool_pre_ping boolean No true —
pool_size integer No 10 min=1
max_overflow integer No 20 min=0
pool_timeout integer No 30 min=1
pool_recycle integer No 1800 min=-1
isolation_level string | null No null —

ColumnConfig

Field Type Required Default Schema constraints
type string No "string" —
nullable boolean No true —
primary_key boolean No false —
unique boolean No false —
index boolean No false —
default Any No null —
max_length integer | null No null min=1

ResourceConfig

Field Type Required Default Schema constraints
database string No "primary" —
table string Yes — —
path string Yes — —
enabled boolean No true —
auto_create boolean No false —
columns dict[str, ColumnConfig] No {} —
primary_key string No "id" —
allowed_actions list[string] No ["list","read","create","update","delete"] —
permissions dict[str, string] No {} —
readable_fields list[string] | null No null —
writable_fields list[string] | null No null —
hidden_fields list[string] No [] —
default_limit integer No 50 min=1
max_limit integer No 200 min=1
allowed_filters list[string] No [] —
filter_operators list[enum ["eq","ne","gt","gte","lt","lte","in","like","ilike","isnull"]] No ["eq"] —
search_fields list[string] No [] —
allowed_sort list[string] No [] —
pagination_mode enum ["offset","cursor"] No "offset" —
cursor_field string | null No null —
soft_delete_field string | null No null —
tenant_field string | null No null —
owner_field string | null No null —
owner_actions list[enum ["list","read","update","delete"]] No [] —
owner_bypass_permission string | null No null —
cache ResourceCacheConfig No ResourceCacheConfig() —
create_schema object | null No null —
update_schema object | null No null —
batch_enabled boolean No false —
max_batch_size integer No 100 min=1; max=5000
count_enabled boolean No true —
dependencies list[string] No [] —

MongoDatabaseConfig

Field Type Required Default Schema constraints
uri string Yes — —
database string Yes — —
max_pool_size integer No 100 min=1
min_pool_size integer No 0 min=0
server_selection_timeout_ms integer No 5000 min=100

MongoResourceConfig

Field Type Required Default Schema constraints
database string No "primary" —
collection string Yes — —
path string Yes — —
enabled boolean No true —
allowed_actions list[string] No ["list","read","create","update","delete"] —
permissions dict[str, string] No {} —
writable_fields list[string] | null No null —
hidden_fields list[string] No [] —
allowed_filters list[string] No [] —
filter_operators list[enum ["eq","ne","gt","gte","lt","lte","in"]] No ["eq"] —
allowed_sort list[string] No [] —
default_limit integer No 50 min=1
max_limit integer No 200 min=1
tenant_field string | null No null —
owner_field string | null No null —
owner_actions list[enum ["list","read","update","delete"]] No [] —
owner_bypass_permission string | null No null —
soft_delete_field string | null No null —
cache ResourceCacheConfig No ResourceCacheConfig() —
create_schema object | null No null —
update_schema object | null No null —
dependencies list[string] No [] —

ResourceCacheConfig

Field Type Required Default Schema constraints
enabled boolean | null No null —
ttl_seconds integer | null No null min=1
list_ttl_seconds integer | null No null min=1
read_ttl_seconds integer | null No null min=1
stale_ttl_seconds integer | null No null min=0

Sources and verification

This page describes the behavior at the pinned commits below. Recheck these contracts when upgrading.


English home · All English pages · Version maintenance

Clone this wiki locally