askrobots / dbbasic Public

Model-config web apps: describe the app in configuration instead of writing code. Built on Polars and DuckDB.

0 downloads

dbbasic/customers_crud.yaml
Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 Add DBBasic crate engine logo and update README 0d628db 1 year, 2 months ago History
customers_crud.yaml · 1.2 KB · 60 lines
1# DBBasic CRUD Config - Customers Example
2resource: customers
3database: customers.db
4
5fields:
6 id:
7 type: primary_key
8 name:
9 type: string
10 required: true
11 searchable: true
12 max_length: 100
13 email:
14 type: email
15 unique: true
16 searchable: true
17 required: true
18 phone:
19 type: string
20 max_length: 20
21 credit_limit:
22 type: decimal
23 min: 0
24 max: 100000
25 default: 1000
26 status:
27 type: select
28 options: [active, inactive, pending]
29 default: active
30 created_at:
31 type: timestamp
32 auto_now_add: true
33 updated_at:
34 type: timestamp
35 auto_now: true
36
37interface:
38 list_display: [name, email, status, credit_limit, created_at]
39 search_fields: [name, email]
40 filters: [status, created_at]
41 actions: [export_csv, bulk_delete]
42 per_page: 25
43
44hooks:
45 before_create: validate_business_rules
46 after_create: send_welcome_email
47 before_update: check_permissions
48 after_update: sync_to_crm
49 before_delete: check_dependencies
50
51permissions:
52 create: public # Temporarily set to public for testing
53 read: public
54 update: owner_or_admin
55 delete: admin_only
56
57api:
58 base_path: /api/customers
59 enable_bulk: true
60 enable_export: true