key | owner | token | repo | path | modes |
---|---|---|---|---|---|
1 | db-man | ... | db | dbs | |
2 | db-man | ... | split-table-db | dbs | split-table |
When a database is set split-table
, when update a table record, will only update the table record file, not the whole table file.
- dbs/iam/dbcfg.json All tables in this database, and all columns in each table
- dbs/iam/users.data.json Table data file
- dbs/iam/users/*.json Table record files. These files are split from
users.data.json
file. (Only insplit-table
mode)
Table is defined in dbcfg.json
file.
See src/types/DbTable.ts
An example:
{
"name": "users",
"columns": [
{ "id": "userId", "name": "User ID", "primary": true },
{ "id": "name", "name": "Name" },
{ "id": "age", "name": "Age", "type": "NUMBER" },
{ "id": "active", "name": "Active", "type": "BOOL" },
{ "id": "tags", "name": "Tags", "type": "STRING_ARRAY" },
{
"id": "notes",
"name": "Notes",
"type": "STRING",
"type:createUpdatePage": "TextArea"
}
],
"large": true
}
See src/types/Column.ts
An example:
{
"id": "userId",
"name": "User ID",
"type": "string",
"primary": true
}
See src/types/Column.ts::DbColumnType
See src/types/Column.ts
TODO add description here
See src/types/Column.ts::ColumnPlaceholder
See src/types/Column.ts::RadioGroupUiTypeEnum
See src/types/Column.ts::Column
TODO add description here
TODO add description here
TODO add description here
Set HIDE
will hide this column in table.
{
"id": "product_id",
"type:listPage": "HIDE"
}
On list page, choose the UI component to use for this column.
Below is an example of using ImageLink
component. The string after "ImageLink" is a template (Handlebars).
It will transform the record
which passing from antd Table
component, into a props object like {url:'',imgSrc:''}
.
This props will pass to ImageLink
component.
{
"id": "product_id",
"type:listPage": [
"ImageLink",
"{\"url\":\"https://brickset.com/{{record.product_id}}-1\",\"imgSrc\":\"https://img.brickset.com/{{record.product_id}}-1.jpg\"}"
]
}
On the Random Page, choose the UI component to use for one of the list item.
Below is an example of using ImageLink
component. The string after "ImageLink" is a template (Handlebars).
It will transform the record
which passing from antd Table
component, into a props object like {url:'',imgSrc:''}
.
This props will pass to ImageLink
component.
{
"id": "product_id",
"type:randomPage": [
[
"ImageLink",
"{\"url\":\"{{record.photos.[0]}}\",\"imgSrc\":\"{{record.photos.[0]}}\"}"
]
]
}
- .github/workflows/merge.yml - https://github.com/db-man/split-table-db/blob/main/.github/workflows/merge.yml
- .github/workflows/split.yml - https://github.com/db-man/split-table-db/blob/main/.github/workflows/split.yml
- merge.mjs - https://github.com/db-man/split-table-db/blob/main/merge.mjs
- split.mjs - https://github.com/db-man/split-table-db/blob/main/split.mjs
- cli/utils.mjs - https://github.com/db-man/split-table-db/blob/main/cli/utils.mjs
{
"id": "product_id",
"type:listPage": [
"ImageLink",
"{\"url\":\"https://brickset.com/{{record.product_id}}-1\",\"imgSrc\":\"https://img.brickset.com/{{record.product_id}}-1.jpg\"}"
]
}
"type:listPage"
- render key["ImageLink","{\"url\":\"http://a.com/{{record.id}}\",\"imgSrc\":\"http://b.com/{{record.name}}.jpg\"}"]
- render expressionImageLink
- render expression built-in function name"{\"url\":\"http://a.com/{{record.id}}\",\"imgSrc\":\"http://b.com/{{record.name}}.jpg\"}"]
- render expression function template