Skip to content

Commit

Permalink
[sea-orm-pro] edit
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Dec 18, 2024
1 parent ca2495e commit f67d2e6
Show file tree
Hide file tree
Showing 24 changed files with 489 additions and 240 deletions.
19 changes: 11 additions & 8 deletions sea-orm-pro/docs/01-introduction/01-sea-orm-pro.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# What is SeaORM Pro

* An admin dashboard built on top of SeaORM & Seaography
* Technology - React + GraphQL + Loco.rs
* CRUD operations out of the box
* Nested table for relational entities
* Fully customizable frontend and backend source code
* Supported database: MSSQL, MySQL, PostgreSQL, SQLite

SeaORM Pro is now in closed-beta, and will be based on SeaORM 1.0, so the API surface will be stable and supported long term. We offer an Evaluation License and a Production License with two support tiers. If you are interested, please [contact us](https://forms.office.com/r/gWk7CU9yjV) for pricing information.
SeaORM Pro is an admin dashboard that provides full CRUD interface for your SeaORM entities, includes a GraphQL interface to handles CRUD request.

The source code of the frontend and backend are fully customizable and accessible. The tech stack includes a sleek Ant Design React frontend admin panel, Loco.rs Rust backend server, SeaORM object relational mapper to interact with your relational database and Seaography to extends entity that defines in SeaORM to serve as a GraphQL interface.

There are two kinds of table view in SeaORM Pro, raw table view and composite table view.

For raw table view, each raw table corresponds to a table in the relational database, by default it will display all columns with pagination. You can configure the displayed columns and other settings in a TOML file.

For composite table view, this is where SeaORM Pro shine, data from parent-child tables are represented in collapsible table view. The configuration of each composite table view is specified in the TOML file.

SeaORM Pro is now in closed-beta, and will be based on SeaORM 1.0, so the API surface will be stable and supported long term. We offer an Evaluation License and a Production License with two support tiers.
4 changes: 2 additions & 2 deletions sea-orm-pro/docs/01-introduction/02-sea-orm-pro-free.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SeaORM Pro Free

* Free trial
[SeaORM Pro Free](https://github.com/SeaQL/sea-orm-pro-free) is a free trial of SeaORM Pro with following limitations:

* Readonly admin dashboard
* No access to frontend source code
* Supported database: MSSQL, MySQL, PostgreSQL, SQLite
61 changes: 58 additions & 3 deletions sea-orm-pro/docs/02-install-and-config/01-database.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# Database & Async Runtime

* Using MSSQL database driver
* Supported database: MSSQL, MySQL, PostgreSQL, SQLite
* Supported async runtime: async-std, tokio
First, go to `Cargo.toml` and find the line of `sea-orm` in the `[dependencies]` section.

```toml title="Cargo.toml"
sea-orm = { version = "1.1.0", features = [ <DATABASE_DRIVER>, <ASYNC_RUNTIME>, "macros" ] }
```

You must choose a `DATABASE_DRIVER` and an `ASYNC_RUNTIME`. `macros` is needed if you use SeaORM's generated entities (most likely).

## DATABASE_DRIVER

You can choose one or more from:

+ `sqlz-mssql` - SQLz MSSQL
+ `sqlx-mysql` - SQLx MySQL and MariaDB
+ `sqlx-postgres` - SQLx PostgreSQL
+ `sqlx-sqlite` - SQLx SQLite

See also: [SQLx docs](https://docs.rs/crate/sqlx/latest/features).

:::tip SQL Server (MSSQL) backend

The installation and configuration of MSSQL driver can be found [here](https://www.sea-ql.org/SeaORM-X/docs/install-and-config/database-and-async-runtime/).

:::

## ASYNC_RUNTIME

You have to choose one from:

`runtime-async-std-native-tls`, `runtime-tokio-native-tls`, `runtime-async-std-rustls`, `runtime-tokio-rustls`

Basically, they are in the form of `runtime-ASYNC_RUNTIME-TLS_LIB`:

+ `ASYNC_RUNTIME` can be [`async-std`](https://crates.io/crates/async-std) or [`tokio`](https://crates.io/crates/tokio)
+ `TLS_LIB` can either be [`native-tls`](https://crates.io/crates/native-tls) or [`rustls`](https://crates.io/crates/rustls)

1. Choose the ASYNC_RUNTIME corresponding to your Rust web framework:

| ASYNC_RUNTIME | Web Framework |
| :-----------: | :------------: |
| `async-std` | [`Tide`](https://docs.rs/tide) |
| `tokio` | [`Axum`](https://docs.rs/axum), [`Actix`](https://actix.rs/), [`Poem`](https://docs.rs/poem), [`Rocket`](https://rocket.rs/) |

2. `native-tls` uses the platform's native security facilities, while `rustls` is an (almost) pure Rust implementation.

## Extra features

+ `debug-print` - print every SQL statement to logger
+ `mock` - mock interface for unit testing
+ `macros` - procedural macros for your convenient
+ `with-chrono` - support [`chrono`](https://crates.io/crates/chrono) types
+ `with-time` - support [`time`](https://crates.io/crates/time) types
+ `with-json` - support [`serde-json`](https://crates.io/crates/serde-json) types
+ `with-rust_decimal` - support [`rust_decimal`](https://crates.io/crates/rust_decimal) types
+ `with-bigdecimal` - support [`bigdecimal`](https://crates.io/crates/bigdecimal) types
+ `with-uuid` - support [`uuid`](https://crates.io/crates/uuid) types
+ `postgres-array` - support array types in Postgres (automatically enabled when `sqlx-postgres` feature is turned on)
+ `sea-orm-internal` - opt-in unstable internal APIs (for accessing re-export SQLx types)
26 changes: 22 additions & 4 deletions sea-orm-pro/docs/02-install-and-config/02-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,28 @@

## SeaORM Pro

* Organization of frontend source code
* Running frontend in development mode
* Build and serve frontend artifact
```sh
cd sea-orm-pro

# Install dependency
npm install

# Run frontend in development mode
# Visit admin at `http://localhost:8085/`
npm run dev

# Build frontend artifact
npm run build

# Copy frontend artifact to backend and serve statically
...
```

## SeaORM Pro Free

* Download frontend artifact
```sh
cd sea-orm-pro-free

# Download frontend artifact
sh build_tools/download_frontend.sh
```
19 changes: 15 additions & 4 deletions sea-orm-pro/docs/03-site-config/01-theme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Theme

* `title`: title of admin dashboard
* `logo`: file path of admin dashboard logo
* `login_banner`: file path of admin dashboard login banner
* `copyright`: copyright of admin dashboard
```toml
[site.theme]

# Title of admin dashboard
title = "SeaORM Pro FREE"

# File path of admin dashboard logo
logo = "/admin/favicon.ico"

# File path of admin dashboard login banner
login_banner = "/admin/logo.png"

# Copyright of admin dashboard
copyright = "Powered by SeaORM Pro"
```
63 changes: 52 additions & 11 deletions sea-orm-pro/docs/04-raw-table-config/01-table.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,54 @@
# Table

* `columns`: column specific config
* `title`: display title
* `field`: name of the SQL column
* `relation`: name of the SeaORM relation
* `width`: display width
* `input_type`: data type
* `ellipsis`: clip long text
* `all_columns`: show all columns including column not mention in the `columns` config
* `page_size`: number of rows per page
* `table_size`: display density
* `name`: rename table title
```toml
[table]

# Column specific config
columns = [
{
# Display title
title = "ID",

# Name of the SQL column
field = "product_id",

# Column width
width = 80
},
{
title = "Thumbnail",

field = "thumb_nail_photo",

# Data type
input_type = "image",

width = 120
},
{
title = "Product Category",

field = "name",

# Name of the SeaORM relation
relation = "product_category",

# Clip long text
ellipsis = false,

width = 180
},
]

# Show all columns including column not mention in the `columns` config
all_columns = false

# Number of rows per page
page_size = 20

# Display density, options: large, middle, small
table_size = "middle"

# Rename table title
name = "Products"
```
26 changes: 22 additions & 4 deletions sea-orm-pro/docs/04-raw-table-config/02-view.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# View

* `hidden_columns`: list of columns that are hidden on the view table
* `order_by`: sorter of the view table
* `field`: sort by which column
* `order`: in ASC / DESC direction
```toml
[view]

# List of columns that are hidden on the view table
hidden_columns = [
"name_style",
"suffix",
"email_address",
"phone",
"rowguid",
"modified_date",
]

# Sorter of the view table
order_by = {
# Sort by which column
field = "customer_id",

# Sort in ASC / DESC direction
order = "desc"
}
```
14 changes: 12 additions & 2 deletions sea-orm-pro/docs/04-raw-table-config/03-create.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Create

* `enable`: is create allowed for this table?
* `hidden_columns`: list of columns that are hidden on the create form
```toml
[create]

# Is create allowed for this table?
enable = true

# List of columns that are hidden on the create form
hidden_columns = [
"created_at",
"updated_at",
]
```
21 changes: 18 additions & 3 deletions sea-orm-pro/docs/04-raw-table-config/04-update.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Update

* `enable`: is update allowed for this table?
* `hidden_columns`: list of columns that are hidden on the update form
* `readonly_columns`: list of columns that are readonly on the update form
```toml
[update]

# Is update allowed for this table?
enable = true

# List of columns that are hidden on the update form
hidden_columns = [
"created_at",
"updated_at",
]

# List of columns that are readonly on the update form
readonly_columns = [
"id",
]
```

7 changes: 6 additions & 1 deletion sea-orm-pro/docs/04-raw-table-config/05-delete.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Delete

* `enable`: is delete allowed for this table?
```toml
[delete]

# Is delete allowed for this table?
enable = true
```
95 changes: 88 additions & 7 deletions sea-orm-pro/docs/05-composite-table-config/01-parent-table.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,90 @@
# Parent Table

* `name`: name of the parent table
* `parent_config`: table config of the parent table
* [`table`](04-raw-table-config/01-table.md)
* [`view`](04-raw-table-config/02-view.md)
* [`create`](04-raw-table-config/03-create.md)
* [`update`](04-raw-table-config/04-update.md)
* [`delete`](04-raw-table-config/05-delete.md)
```toml
[parent]

# Name of the parent table
name = "sales_order_header"


# Table config of the parent table
[parent.table]

# Column specific config
columns = [
{ title = "ID", field = "sales_order_id", width = 80 },
{ field = "order_date" },
{ field = "purchase_order_number" },
{ field = "account_number" },
{ field = "ship_method" },
{ field = "sub_total" },
{ field = "tax_amt" },
{ field = "freight" },
]

# Show all columns including column not mention in the `columns` config
all_columns = false

# Number of rows per page
page_size = 20

# Display density, options: large, middle, small
table_size = "middle"

# Rename table title
name = "Sales Orders"


# View config of the parent table
[parent.view]

# List of columns that are hidden on the view table
hidden_columns = [
"modified_date",
]

# Sorter of the view table
order_by = {
# Sort by which column
field = "id",

# Sort in ASC / DESC direction
order = "desc"
}


# Create config of the parent table
[parent.create]

# Is create allowed for this table?
enable = true

# List of columns that are hidden on the create form
hidden_columns = [
"modified_date",
]


# Update config of the parent table
[parent.update]

# Is update allowed for this table?
enable = true

# List of columns that are hidden on the update form
hidden_columns = [
"modified_date",
]

# List of columns that are readonly on the update form
readonly_columns = [
"id",
]


# Delete config of the parent table
[parent.delete]

# Is delete allowed for this table?
enable = true
```
Loading

0 comments on commit f67d2e6

Please sign in to comment.