askrobots / dbbasic Public

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

0 downloads

dbbasic/examples/simple_crm.dbbasic
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
simple_crm.dbbasic · 863 bytes · 32 lines
1# Simple CRM - 30 lines replaces Salesforce
2# This is what Rails generators could never achieve
3
4name: "Simple CRM"
5version: 1.0
6
7model:
8 accounts:
9 fields: [id, name, industry, revenue, created]
10 indexes: [name, created]
11
12 contacts:
13 fields: [id, account_id, name, email, phone, title]
14 relations:
15 account_id: accounts.id
16
17 opportunities:
18 fields: [id, account_id, amount, stage, close_date]
19 relations:
20 account_id: accounts.id
21 workflow:
22 states: [lead, qualified, proposal, negotiation, closed_won, closed_lost]
23
24views:
25 pipeline: "SELECT stage, SUM(amount) as total FROM opportunities GROUP BY stage"
26 top_accounts: "SELECT * FROM accounts ORDER BY revenue DESC LIMIT 10"
27 recent_contacts: "SELECT * FROM contacts ORDER BY id DESC LIMIT 20"
28
29forms:
30 account_form: auto
31 contact_form: auto
32 opportunity_form: auto