Skip to content

Commit

Permalink
Merge pull request #2129 from undb-io/release/v1.0.0-116
Browse files Browse the repository at this point in the history
Release version v1.0.0-116
  • Loading branch information
nichenqin authored Nov 8, 2024
2 parents f0055e2 + 6040120 commit ca4b18d
Show file tree
Hide file tree
Showing 19 changed files with 419 additions and 71 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## v1.0.0-116


### 🚀 Enhancements

- Add other date formula ([612819b](https://github.com/undb-io/undb/commit/612819b))

### ❤️ Contributors

- Nichenqin ([@nichenqin](http://github.com/nichenqin))

## v1.0.0-115


Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ UNDB is a no-code platform that can also serve as a Backend as a Service (BaaS).
- 🗄️ Based on SQLite, a lightweight database
- 🔐 Private and local first
- 📦 Can be packaged into a binary file using Bun
- 📊 Support formula field like Excel/Airtable
- 🌐 OpenAPI RESTful API support
- 🪜 Progressive deployment, from local in single file to cloud complicated stacks.
- 🐳 Supports Docker deployment
- 🛠️ Provides a UI for table management
Expand All @@ -49,6 +51,7 @@ UNDB is a no-code platform that can also serve as a Backend as a Service (BaaS).
![kanban](./docs/images/kanban.jpeg)
![gallery](./docs/images/gallery.jpeg)
![form](./docs/images/form.jpeg)
![calendar](./docs/images/calendar.jpeg)
![openapi](./docs/images/openapi.jpeg)

## Quick start
Expand Down
22 changes: 11 additions & 11 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"build:docker": "bun build --compile src/index.ts --target=bun --packages=external --sourcemap --outfile undb"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.674.0",
"@aws-sdk/s3-request-presigner": "^3.674.0",
"@aws-sdk/client-s3": "^3.686.0",
"@aws-sdk/s3-request-presigner": "^3.686.0",
"@elysiajs/cors": "1.1.0",
"@elysiajs/cron": "1.1.0",
"@elysiajs/html": "1.1.0",
"@elysiajs/opentelemetry": "^1.1.6",
"@elysiajs/opentelemetry": "^1.1.7",
"@elysiajs/static": "1.1.0",
"@elysiajs/stream": "1.1.0",
"@elysiajs/swagger": "^1.1.5",
Expand All @@ -25,11 +25,11 @@
"@undb/authz": "workspace:*",
"@undb/base": "workspace:*",
"@undb/command-handlers": "workspace:*",
"@undb/event-handlers": "workspace:*",
"@undb/context": "workspace:*",
"@undb/cqrs": "workspace:*",
"@undb/dashboard": "workspace:*",
"@undb/di": "workspace:*",
"@undb/event-handlers": "workspace:*",
"@undb/graphql": "workspace:*",
"@undb/logger": "workspace:*",
"@undb/openapi": "workspace:*",
Expand All @@ -42,16 +42,16 @@
"@undb/trpc": "workspace:*",
"@undb/webhook": "workspace:*",
"arctic": "^1.9.2",
"bun": "^1.1.31",
"core-js": "^3.38.1",
"bun": "^1.1.34",
"core-js": "^3.39.0",
"elysia": "1.1.7",
"got": "^14.4.3",
"got": "^14.4.4",
"handlebars": "^4.7.8",
"lucia": "^3.2.1",
"lucia": "^3.2.2",
"mailgun-nodemailer-transport": "^3.0.2",
"minio": "^8.0.1",
"nanoid": "^5.0.7",
"nodemailer": "^6.9.15",
"minio": "^8.0.2",
"nanoid": "^5.0.8",
"nodemailer": "^6.9.16",
"oslo": "^1.2.1",
"radash": "^12.1.0",
"reflect-metadata": "^0.2.2",
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"tauri": "tauri"
},
"dependencies": {
"@tauri-apps/api": "^2.0.2"
"@tauri-apps/api": "^2.0.3"
},
"devDependencies": {
"@tauri-apps/cli": "^1.6.3",
"typescript": "^5.6.3",
"vite": "^5.4.9"
"vite": "^5.4.10"
}
}
47 changes: 23 additions & 24 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
"@neoconfetti/svelte": "^2.2.1",
"@svelte-put/copy": "^3.0.2",
"@svelte-put/shortcut": "^3.1.1",
"@sveltejs/adapter-static": "^3.0.5",
"@sveltejs/kit": "^2.7.1",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.8.0",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@tailwindcss/typography": "^0.5.15",
"@tanstack/eslint-plugin-query": "^5.59.7",
"@tanstack/eslint-plugin-query": "^5.59.20",
"@types/eslint": "^8.56.12",
"@types/lodash.unzip": "^3.4.9",
"@types/papaparse": "^5.3.14",
"@types/papaparse": "^5.3.15",
"@types/sortablejs": "latest",
"@typescript-eslint/eslint-plugin": "^8.10.0",
"@typescript-eslint/parser": "^8.10.0",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.13.0",
"@undb/commands": "workspace:*",
"@undb/domain": "workspace:*",
"@undb/formula": "workspace:*",
Expand All @@ -44,10 +44,10 @@
"array-move": "^4.0.0",
"autoprefixer": "^10.4.20",
"date-fns": "^4.1.0",
"eslint": "^9.12.0",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.45.1",
"houdini": "^1.2.64",
"eslint-plugin-svelte": "^2.46.0",
"houdini": "^1.3.0",
"houdini-svelte": "^1.2.64",
"lodash.unzip": "^3.4.0",
"papaparse": "^5.4.1",
Expand All @@ -62,21 +62,20 @@
"sortablejs": "^1.15.3",
"svelte": "^4.2.19",
"svelte-check": "^4.0.5",
"svelte-dnd-action": "^0.9.51",
"svelte-headless-table": "^0.18.2",
"svelte-headless-table": "^0.18.3",
"svelte-inview": "^4.0.4",
"svelte-jsoneditor": "^1.0.8",
"svelte-jsoneditor": "^1.1.2",
"svelte-persisted-store": "^0.11.0",
"sveltekit-search-params": "^3.0.0",
"svelvet": "^10.0.2",
"tailwindcss": "^3.4.14",
"timeago.js": "^4.0.2",
"tslib": "^2.8.0",
"tslib": "^2.8.1",
"type-fest": "^4.26.1",
"typescript": "^5.6.3",
"vite": "^5.4.9",
"vite": "^5.4.10",
"vite-plugin-node-polyfills": "^0.22.0",
"vitest": "^2.1.3",
"vitest": "^2.1.4",
"xlsx": "^0.18.5"
},
"type": "module",
Expand All @@ -85,32 +84,32 @@
"@codemirror/commands": "^6.7.1",
"@codemirror/language": "^6.10.3",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.34.1",
"@codemirror/view": "^6.34.2",
"@floating-ui/dom": "^1.6.12",
"@formkit/auto-animate": "^0.8.2",
"@internationalized/date": "^3.5.6",
"@svelte-put/clickoutside": "^3.0.2",
"@tanstack/svelte-query": "^5.59.13",
"@tanstack/svelte-virtual": "^3.10.8",
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/starter-kit": "^2.8.0",
"@tanstack/svelte-query": "^5.59.20",
"@tanstack/svelte-virtual": "^3.10.9",
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"@tiptap/starter-kit": "^2.9.1",
"@trpc/client": "^10.45.2",
"@undb/zod": "workspace:*",
"bits-ui": "^0.21.16",
"clsx": "^2.1.1",
"cmdk-sv": "^0.0.18",
"embla-carousel-svelte": "^8.3.0",
"embla-carousel-svelte": "^8.3.1",
"formsnap": "^1.0.1",
"fuse.js": "^7.0.0",
"lucide-svelte": "^0.453.0",
"mode-watcher": "^0.4.1",
"paneforge": "^0.0.6",
"svelte-grid": "^5.1.2",
"svelte-qrcode": "^1.0.0",
"svelte-qrcode": "^1.0.1",
"svelte-radix": "^1.1.1",
"svelte-sonner": "^0.3.28",
"sveltekit-superforms": "^2.19.1",
"sveltekit-superforms": "^2.20.0",
"tailwind-merge": "^2.5.4",
"tailwind-variants": "^0.2.1",
"trpc-svelte-query-adapter": "^2.3.14",
Expand Down
Binary file modified bun.lockb
Binary file not shown.
Binary file added docs/images/calendar.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "undb",
"version": "1.0.0-115",
"version": "1.0.0-116",
"private": true,
"scripts": {
"build": "NODE_ENV=production bun --bun turbo build",
Expand All @@ -23,17 +23,17 @@
"drizzle-kit": "^0.26.2",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"npm-run-all2": "^6.2.4",
"npm-run-all2": "^7.0.1",
"prettier": "^3.3.3",
"turbo": "^2.1.3"
"turbo": "^2.2.3"
},
"lint-staged": {
"**/*": "bunx --bun prettier --write --ignore-unknown"
},
"engines": {
"node": ">=18"
},
"packageManager": "[email protected].31",
"packageManager": "[email protected].34",
"workspaces": [
"apps/*",
"packages/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/domain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"array-move": "^4.0.0",
"date-fns": "^4.1.0",
"dequal": "^2.0.3",
"nanoid": "^5.0.7",
"nanoid": "^5.0.8",
"oxide.ts": "^1.1.0",
"uuid": "^10.0.0"
}
Expand Down
12 changes: 12 additions & 0 deletions packages/formula/src/formula.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ export const FORMULA_FUNCTIONS: FormulaFunction[] = [
"SEARCH",
"SUBSTR",

// 日期时间
"DATE_ADD",
"DATE_SUBTRACT",
"DATE_DIFF",
"YEAR",
"MONTH",
"DAY",
"HOUR",
"MINUTE",
"SECOND",
"WEEKDAY",

// 逻辑运算
"AND",
"OR",
Expand Down
67 changes: 67 additions & 0 deletions packages/formula/src/formula/formula.registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,70 @@ globalFormulaRegistry.register(
["XOR({{field1}}, false)", undefined],
],
)

globalFormulaRegistry.register("DATE_ADD", [["date", "number", "string"]], "date", "Adds a number of date to date", [
["DATE_ADD('2024-01-01', 1, 'day')", "2024-01-02"],
["DATE_ADD('2024-01-01', 1, 'month')", "2024-02-01"],
["DATE_ADD('2024-01-01', 1, 'year')", "2025-01-01"],
["DATE_ADD('2024-01-01', 1, 'hour')", "2024-01-01 01:00:00"],
["DATE_ADD('2024-01-01', 1, 'minute')", "2024-01-01 00:01:00"],
["DATE_ADD('2024-01-01', 1, 'second')", "2024-01-01 00:00:01"],
["DATE_ADD({{field1}}, 1, 'day')", undefined],
])
globalFormulaRegistry.register(
"DATE_SUBTRACT",
[["date", "number", "string"]],
"date",
"Subtracts a number of date from date",
[
["DATE_SUBTRACT('2024-01-01', 1, 'day')", "2023-12-31"],
["DATE_SUBTRACT('2024-01-01', 1, 'month')", "2023-12-01"],
["DATE_SUBTRACT('2024-01-01', 1, 'year')", "2023-01-01"],
["DATE_SUBTRACT('2024-01-01', 1, 'hour')", "2023-12-31 23:00:00"],
["DATE_SUBTRACT('2024-01-01', 1, 'minute')", "2023-12-31 23:59:00"],
["DATE_SUBTRACT('2024-01-01', 1, 'second')", "2023-12-31 23:59:59"],
["DATE_SUBTRACT({{field1}}, 1, 'day')", undefined],
],
)

globalFormulaRegistry.register(
"DATE_DIFF",
[["date", "date", "string"]],
"number",
"Returns the difference between two dates in the specified unit.",
[
["DATE_DIFF('2024-01-01', '2024-01-02', 'day')", 1],
["DATE_DIFF('2024-01-01', '2024-01-02', 'month')", 0],
["DATE_DIFF('2024-01-01', '2024-01-02', 'year')", 0],
["DATE_DIFF({{field1}}, {{field2}}, 'day')", undefined],
],
)

globalFormulaRegistry.register("YEAR", [["date"]], "number", "Returns the year of a date.", [
["YEAR('2024-01-01')", 2024],
["YEAR({{field1}})", undefined],
])
globalFormulaRegistry.register("MONTH", [["date"]], "number", "Returns the month of a date.", [
["MONTH('2024-01-01')", 1],
["MONTH({{field1}})", undefined],
])
globalFormulaRegistry.register("DAY", [["date"]], "number", "Returns the day of a date.", [
["DAY('2024-01-01')", 1],
["DAY({{field1}})", undefined],
])
globalFormulaRegistry.register("HOUR", [["date"]], "number", "Returns the hour of a date.", [
["HOUR('2024-01-01 01:00:00')", 1],
["HOUR({{field1}})", undefined],
])
globalFormulaRegistry.register("MINUTE", [["date"]], "number", "Returns the minute of a date.", [
["MINUTE('2024-01-01 01:00:00')", 0],
["MINUTE({{field1}})", undefined],
])
globalFormulaRegistry.register("SECOND", [["date"]], "number", "Returns the second of a date.", [
["SECOND('2024-01-01 01:00:00')", 0],
["SECOND({{field1}})", undefined],
])
globalFormulaRegistry.register("WEEKDAY", [["date"]], "number", "Returns the weekday of a date.", [
["WEEKDAY('2024-01-01')", 2],
["WEEKDAY({{field1}})", undefined],
])
19 changes: 11 additions & 8 deletions packages/formula/src/formula/formula.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ export type FormulaFunction =
| "SEARCH"
| "SUBSTR"

// // 日期时间
// 日期时间
| "DATE_ADD"
| "DATE_SUBTRACT"
| "DATE_DIFF"
| "YEAR"
| "MONTH"
| "DAY"
// | "NOW"
// | "TODAY"
// | "YEAR"
// | "MONTH"
// | "DAY"
// | "HOUR"
// | "MINUTE"
// | "SECOND"
// | "WEEKDAY"
| "HOUR"
| "MINUTE"
| "SECOND"
| "WEEKDAY"
// | "DATE"

// 逻辑运算
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"@envelop/opentelemetry": "^6.3.1",
"@opentelemetry/api": "^1.9.0",
"graphql": "16.8.1",
"graphql-yoga": "^5.7.0"
"graphql-yoga": "^5.8.0"
}
}
6 changes: 3 additions & 3 deletions packages/persistence/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"@libsql/client": "^0.14.0",
"@libsql/kysely-libsql": "^0.4.1",
"@undb/audit": "workspace:*",
"@undb/cqrs": "workspace:*",
"@undb/authz": "workspace:*",
"@undb/base": "workspace:*",
"@undb/context": "workspace:*",
"@undb/cqrs": "workspace:*",
"@undb/di": "workspace:*",
"@undb/domain": "workspace:*",
"@undb/formula": "workspace:*",
Expand All @@ -28,8 +28,8 @@
"@undb/user": "workspace:*",
"@undb/webhook": "workspace:*",
"date-fns": "^4.1.0",
"drizzle-orm": "^0.35.1",
"es-toolkit": "^1.25.2",
"drizzle-orm": "^0.36.1",
"es-toolkit": "^1.26.1",
"kysely": "^0.27.4",
"kysely-bun-sqlite": "^0.3.2",
"radash": "^12.1.0",
Expand Down
Loading

0 comments on commit ca4b18d

Please sign in to comment.