Vendor dependencies

This commit is contained in:
2026-08-01 16:11:49 +03:00
parent 7f139a0241
commit 6b5e7f0f8b
29706 changed files with 9575646 additions and 0 deletions
+165
View File
@@ -0,0 +1,165 @@
# Release Process
This is the release checklist for SeaORM release candidates.
## 1. Choose Version
Check the latest published SeaORM version:
```sh
cargo search sea-orm --limit 5
git tag --list '2.0.0-rc*' --sort=-v:refname | head
```
For a new release candidate, bump to the next `2.0.0-rc.N`.
## 2. Start Clean
Release from `master` after the release PR has been merged and CI has passed.
```sh
git switch master
git pull --ff-only
git status --short
```
The worktree should be clean before starting.
## 3. Bump Versions
Run the bump script:
```sh
bash build-tools/bump.sh 2.0.0-rc.N
```
This creates two commits:
```text
2.0.0-rc.N
update examples
```
The first commit bumps the publishable crate manifests:
- `sea-orm`
- `sea-orm-codegen`
- `sea-orm-cli`
- `sea-orm-macros`
- `sea-orm-migration`
- `sea-orm-sync`
The second commit bumps example `sea-orm` / `sea-orm-migration` dependency comments.
`bump.sh` detects GNU vs BSD `sed`, so it runs on both Linux and macOS.
## 4. Write Changelog
Create a release note file:
```text
changelog/2.0.0-rc.N.md
```
Then link it from `CHANGELOG.md` under `2.0.0 - pending > Release Candidates`.
The changelog should call out:
- user-facing features and fixes
- dependency upgrades
- MSRV changes
- compatibility notes
- expected behavior changes
- example or migration updates
Commit it separately:
```sh
git add CHANGELOG.md changelog/2.0.0-rc.N.md
git commit -m "Add changelog for 2.0.0-rc.N"
```
## 5. Validate Locally
Run the main workspace and the separate workspaces:
```sh
cargo check --workspace
cargo check --manifest-path sea-orm-cli/Cargo.toml
cargo check --manifest-path sea-orm-migration/Cargo.toml
cargo check --manifest-path sea-orm-sync/Cargo.toml
```
Known warnings are acceptable only if they already exist and are unrelated to the release.
## 6. Push and Wait for CI
Push `master`:
```sh
git push origin master
```
Wait for GitHub Actions to pass before publishing. Do not publish while CI is still running or red.
## 7. Publish Crates
After CI passes, run:
```sh
bash build-tools/publish.sh
```
The publish order is:
1. `sea-orm-codegen`
2. `sea-orm-cli`
3. `sea-orm-macros`
4. `sea-orm`
5. `sea-orm-migration`
6. `sea-orm-sync`
If crates.io indexing causes a dependent publish to fail, wait briefly and retry the failed crate.
## 8. Tag and GitHub Release
After publishing succeeds:
```sh
git tag 2.0.0-rc.N
git push origin 2.0.0-rc.N
```
Create a GitHub Release using `changelog/2.0.0-rc.N.md` as the release body.
## 8b. Release prebuilt `sea-orm-cli` binaries
The `.github/workflows/sea-orm-cli-release.yml` workflow builds prebuilt
`sea-orm-cli` binaries and powers `cargo binstall sea-orm-cli`. It triggers on a
**separate** tag namespace, `sea-orm-cli@<version>`, not the `2.0.0-rc.N` release
tag — so it does nothing unless that tag is pushed.
Create the tag as **annotated**, because the workflow's `gh release create
--notes-from-tag` reads the tag's message (a lightweight tag yields empty notes):
```sh
git tag -a "sea-orm-cli@2.0.0-rc.N" -m "sea-orm-cli 2.0.0-rc.N"
git push origin "sea-orm-cli@2.0.0-rc.N"
```
The workflow then builds the 5 targets, attaches the archives to a draft release,
and publishes it. Confirm the assets appear on the `sea-orm-cli@2.0.0-rc.N`
release and that `cargo binstall sea-orm-cli` resolves.
## 9. Verify
Confirm crates.io shows the new versions:
```sh
cargo search sea-orm --limit 5
cargo search sea-orm-cli --limit 5
cargo search sea-orm-migration --limit 5
cargo search sea-orm-sync --limit 5
```
Also check that docs.rs builds have started or completed.
@@ -0,0 +1 @@
cp sea-orm-sync/src/driver/rusqlite.rs ./src/driver/
+52
View File
@@ -0,0 +1,52 @@
#!/bin/bash
set -e
# In-place sed differs between GNU (Linux) and BSD (macOS) sed:
# GNU accepts `sed -i`, while BSD requires an explicit empty suffix `sed -i ''`.
# Detect once and reuse so this script works on both.
if sed --version 2>/dev/null | grep -q GNU; then
SI=(sed -i)
else
SI=(sed -i '')
fi
# Bump `sea-orm-codegen` version
cd sea-orm-codegen
"${SI[@]}" 's/^version.*$/version = "'$1'"/' Cargo.toml
cd ..
# Bump `sea-orm-cli` version
cd sea-orm-cli
"${SI[@]}" 's/^version.*$/version = "'$1'"/' Cargo.toml
"${SI[@]}" 's/^sea-orm-codegen [^,]*,/sea-orm-codegen = { version = "\='$1'",/' Cargo.toml
cd ..
# Bump `sea-orm-macros` version
cd sea-orm-macros
"${SI[@]}" 's/^version.*$/version = "'$1'"/' Cargo.toml
cd ..
# Bump `sea-orm` version
"${SI[@]}" 's/^version.*$/version = "'$1'"/' Cargo.toml
"${SI[@]}" 's/^sea-orm-macros [^,]*,/sea-orm-macros = { version = "'~$1'",/' Cargo.toml
# Bump `sea-orm-migration` version
cd sea-orm-migration
"${SI[@]}" 's/^version.*$/version = "'$1'"/' Cargo.toml
"${SI[@]}" 's/^sea-orm-cli [^,]*,/sea-orm-cli = { version = "'~$1'",/' Cargo.toml
"${SI[@]}" 's/^sea-orm [^,]*,/sea-orm = { version = "'~$1'",/' Cargo.toml
cd ..
# Bump `sea-orm-sync` version
cd sea-orm-sync
"${SI[@]}" 's/^version.*$/version = "'$1'"/' Cargo.toml
cd ..
git commit -am "$1"
# Bump examples' dependency version
cd examples
find . -depth -type f -name '*.toml' -exec "${SI[@]}" 's/^version = ".*" # sea-orm version$/version = "'~$1'" # sea-orm version/' {} \;
find . -depth -type f -name '*.toml' -exec "${SI[@]}" 's/^version = ".*" # sea-orm-migration version$/version = "'~$1'" # sea-orm-migration version/' {} \;
git add .
git commit -m "update examples"
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
set -x
for dir in */; do
cd "$dir";
cargo clean;
cd ..;
done
@@ -0,0 +1,5 @@
#!/bin/bash
set -e
find examples/ -depth -type f -name '*.toml' -exec sed -i '/^path = "..\/..\/..\/sea-orm-migration"/d' {} \;
find examples/ -depth -type f -name '*.toml' -exec sed -i '/^path = "..\/..\/..\/"/d' {} \;
@@ -0,0 +1,88 @@
services:
#
# MySQL
#
mysql_lts:
image: mysql:lts
ports:
- 3306
environment:
MYSQL_HOST: 127.0.0.1
MYSQL_DATABASE: mysql
MYSQL_USER: sea
MYSQL_PASSWORD: sea
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1"]
interval: 10s
timeout: 5s
retries: 3
mysql_5_7:
image: mysql:5.7
ports:
- 3306
environment:
MYSQL_HOST: 127.0.0.1
MYSQL_DATABASE: mysql
MYSQL_USER: sea
MYSQL_PASSWORD: sea
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1"]
interval: 10s
timeout: 5s
retries: 3
#
# MariaDB
#
mariadb_lts:
image: mariadb:lts
ports:
- 3306
environment:
MARIADB_HOST: 127.0.0.1
MARIADB_DATABASE: mysql
MARIADB_USER: sea
MARIADB_PASSWORD: sea
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: "yes"
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
timeout: 5s
retries: 3
#
# PostgreSQL
#
postgres_16:
image: postgres:16
ports:
- 5432
environment:
POSTGRES_HOST: 127.0.0.1
POSTGRES_USER: root
POSTGRES_PASSWORD: root
healthcheck:
test: ["CMD", "pg_isready", "-U", "root"]
interval: 10s
timeout: 5s
retries: 5
postgres_14:
image: postgres:14
ports:
- 5432
environment:
POSTGRES_HOST: 127.0.0.1
POSTGRES_USER: root
POSTGRES_PASSWORD: root
healthcheck:
test: ["CMD", "pg_isready", "-U", "root"]
interval: 10s
timeout: 5s
retries: 5
@@ -0,0 +1,101 @@
# Some Common Docker Commands You Might Need (use with caution)
#
# Delete all containers
# $ docker rm -f $(docker ps -a -q)
#
# Delete all volumes
# $ docker volume rm $(docker volume ls -q)
#
# Delete all images
# $ docker image rm $(docker image ls -q)
# Setup MariaDB
docker run \
--name "mariadb-10.6" \
--env MYSQL_DB="mysql" \
--env MYSQL_USER="sea" \
--env MYSQL_PASSWORD="sea" \
--env MYSQL_ALLOW_EMPTY_PASSWORD="yes" \
--env MYSQL_ROOT_PASSWORD="root" \
-d -p 3306:3306 mariadb:10.6
docker stop "mariadb-10.6"
docker run \
--name "mariadb-10.5" \
--env MYSQL_DB="mysql" \
--env MYSQL_USER="sea" \
--env MYSQL_PASSWORD="sea" \
--env MYSQL_ALLOW_EMPTY_PASSWORD="yes" \
--env MYSQL_ROOT_PASSWORD="root" \
-d -p 3306:3306 mariadb:10.5
docker stop "mariadb-10.5"
docker run \
--name "mariadb-10.4" \
--env MYSQL_DB="mysql" \
--env MYSQL_USER="sea" \
--env MYSQL_PASSWORD="sea" \
--env MYSQL_ALLOW_EMPTY_PASSWORD="yes" \
--env MYSQL_ROOT_PASSWORD="root" \
-d -p 3306:3306 mariadb:10.4
docker stop "mariadb-10.4"
# Setup MySQL
docker run \
--name "mysql-8.0" \
--env MYSQL_DB="mysql" \
--env MYSQL_USER="sea" \
--env MYSQL_PASSWORD="sea" \
--env MYSQL_ALLOW_EMPTY_PASSWORD="yes" \
--env MYSQL_ROOT_PASSWORD="root" \
-d -p 3306:3306 mysql:8.0
docker stop "mysql-8.0"
docker run \
--name "mysql-5.7" \
--env MYSQL_DB="mysql" \
--env MYSQL_USER="sea" \
--env MYSQL_PASSWORD="sea" \
--env MYSQL_ALLOW_EMPTY_PASSWORD="yes" \
--env MYSQL_ROOT_PASSWORD="root" \
-d -p 3306:3306 mysql:5.7
docker stop "mysql-5.7"
# Setup PostgreSQL
docker run \
--name "postgres-vector-14" \
--env POSTGRES_USER="sea" \
--env POSTGRES_PASSWORD="sea" \
-d -p 5432:5432 pgvector/pgvector:pg14
docker stop "postgres-vector-14"
docker run \
--name "postgres-14" \
--env POSTGRES_USER="sea" \
--env POSTGRES_PASSWORD="sea" \
-d -p 5432:5432 postgres:14
docker stop "postgres-14"
docker run \
--name "postgres-13" \
--env POSTGRES_USER="sea" \
--env POSTGRES_PASSWORD="sea" \
-d -p 5432:5432 postgres:13
docker stop "postgres-13"
docker run \
--name "postgres-12" \
--env POSTGRES_USER="sea" \
--env POSTGRES_PASSWORD="sea" \
-d -p 5432:5432 postgres:12
docker stop "postgres-12"
docker run \
--name "postgres-11" \
--env POSTGRES_USER="sea" \
--env POSTGRES_PASSWORD="sea" \
-d -p 5432:5432 postgres:11
docker stop "postgres-11"
+95
View File
@@ -0,0 +1,95 @@
#!/usr/bin/env bash
set -euo pipefail
# macOS (BSD) sed requires an empty-string argument after -i; GNU sed does not
if sed --version 2>/dev/null | grep -q GNU; then
SI=(sed -i)
else
SI=(sed -i '')
fi
sed_in_place() {
local expression="$1"
shift
"${SI[@]}" "$expression" "$@"
}
replace_rs() {
local expression="$1"
shift
find "$@" -type f -name '*.rs' -exec "${SI[@]}" "$expression" {} +
}
rm -rf sea-orm-sync/src
rm -rf sea-orm-sync/tests
cp -r src sea-orm-sync
cp -r tests sea-orm-sync
cp examples/quickstart/src/main.rs sea-orm-sync/examples/quickstart/src/main.rs
rm -rf sea-orm-sync/src/bin
cd sea-orm-sync
replace_rs "s/Pin<Box<dyn Future<Output = Result<Self::Stream<'a>, DbErr>> + 'a + Send>>/Result<Self::Stream<'a>, DbErr>/" src
replace_rs "s/Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'b>>/Result<T, E>/" src
replace_rs "s/Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'c>>/Result<T, E>/" src
replace_rs 's/Box::pin(async move {/({/' src
replace_rs 's/Box::pin(async move {/({/' tests
replace_rs 's/AsyncFnOnce/FnOnce/g' src
replace_rs 's/transaction_with_config_async/transaction_with_config/g' src tests
replace_rs 's/transaction_async/transaction/g' src tests
replace_rs 's/async //' src
replace_rs 's/async //' tests
replace_rs 's/async //' examples
replace_rs 's/\.await//' src
replace_rs 's/\.await//' tests
replace_rs 's/\.await//' examples
replace_rs '/#\[async_trait::async_trait/d' src
replace_rs '/#\[async_trait::async_trait/d' tests
replace_rs 's/#\[smol_potat::test\]/#\[test\]/' src
replace_rs '/#\[smol_potat::main\]/d' src
replace_rs '/#\[tokio::main\]/d' examples
replace_rs 's/#\[tokio::test\]/#\[test\]/' src
replace_rs 's/#\[cfg(feature = "sqlx-sqlite")\]/#\[cfg(feature = "rusqlite")\]/' tests
replace_rs '/[a-zA-Z]+<Self>: Send + Sync,/d' src
replace_rs '/[a-zA-Z]+<Self>: Send,/d' src
replace_rs 's/: Send + Sync {/ {/' src
replace_rs "s/type Stream<'a>: Stream/type Stream<'a>: Iterator/" src
replace_rs 's/: Send {/ {/' src
replace_rs 's/>: Send$/>/' src
replace_rs 's/: Sync {/ {/' src
replace_rs 's/Send + Sync + //' src
replace_rs 's/ + Sync//' src
replace_rs 's/ + Send//' src
replace_rs 's/Send + //' src
replace_rs 's/Arc<dyn std::error::Error>/Arc<dyn std::error::Error + Send + Sync>/' src
replace_rs '/T: Send,/d' src
replace_rs '/R::Model: Send,/d' src
replace_rs '/S::Item: Send,/d' src
replace_rs 's/Box::pin/Box::new/' src
replace_rs 's/impl Stream</impl Iterator</' src
replace_rs 's/S: Stream</S: Iterator</' src
replace_rs 's/use futures_util::lock::Mutex;/use std::sync::Mutex;/' src
replace_rs 's/use futures_util::lock::MutexGuard;/use std::sync::MutexGuard;/' src
replace_rs 's/, pin::Pin//' src
replace_rs 's/{pin::Pin, /{/' src
replace_rs 's/{task::Poll, /{/' src
replace_rs 's/{future::Future, /{/' src
replace_rs 's/, task::Poll//' src
replace_rs '/use std::{pin::Pin};/d' src
replace_rs '/use std::{task::Poll};/d' src
replace_rs '/use std::{future::Future};/d' src
replace_rs 's/, future::Future//' src
# delete a `#[cfg(feature = "stream")]` together with the `use futures_util` line it gates,
# so the attribute does not attach to the following item once the import is removed
replace_rs '/^#\[cfg(feature = "stream")\]$/{N;/use futures_util/d;}' src
replace_rs '/use futures_util::Stream/d' src
replace_rs '/use futures_util::{Stream/d' src
replace_rs '/use futures_util::{TryStreamExt,/d' src
replace_rs '/\/\/\/ use futures_util/d' src
replace_rs '/use futures_util::future::BoxFuture;/d' src
replace_rs '/use async_stream::/d' src
replace_rs '/use futures_util::StreamExt/d' tests
replace_rs 's/self.conn.try_lock()/self.conn.try_lock().ok()/' src
sed_in_place 's/self.conn.try_lock().ok()/self.conn.try_lock()/' ./src/driver/rusqlite.rs
cargo +nightly fmt
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
set -e
# publish `sea-orm-codegen`
cd sea-orm-codegen
cargo publish
cd ..
# publish `sea-orm-cli`
cd sea-orm-cli
cargo publish
cd ..
# publish `sea-orm-macros`
cd sea-orm-macros
cargo publish
cd ..
# publish `sea-orm`
cargo publish
# publish `sea-orm-migration`
cd sea-orm-migration
cargo publish
cd ..
# publish `sea-orm-sync`
cd sea-orm-sync
cargo publish
+4
View File
@@ -0,0 +1,4 @@
# Run `sh develop/cargo-readme.sh` on project root to generate `README.md` from `src/lib.rs`
# cargo install cargo-readme
cargo readme --no-badges --no-indent-headings --no-license --no-template --no-title > README.md
cd sea-orm-sync && cargo readme --no-badges --no-indent-headings --no-license --no-template --no-title > README.md
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
set -e
if [ -d ./build-tools ]; then
targets=(
"Cargo.toml"
"sea-orm-cli/Cargo.toml"
"sea-orm-codegen/Cargo.toml"
"sea-orm-macros/Cargo.toml"
"sea-orm-migration/Cargo.toml"
"sea-orm-rocket/Cargo.toml"
)
for target in "${targets[@]}"; do
echo "cargo clippy --manifest-path ${target} --fix --allow-dirty --allow-staged"
cargo clippy --manifest-path "${target}" --fix --allow-dirty --allow-staged
done
examples=(`find examples -type f -name 'Cargo.toml'`)
for example in "${examples[@]}"; do
echo "cargo clippy --manifest-path ${example} --fix --allow-dirty --allow-staged"
cargo clippy --manifest-path "${example}" --fix --allow-dirty --allow-staged
done
else
echo "Please execute this script from the repository root."
fi
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
set -e
taplo fmt
if [ -d ./build-tools ]; then
targets=(
"Cargo.toml"
"sea-orm-cli/Cargo.toml"
"sea-orm-codegen/Cargo.toml"
"sea-orm-macros/Cargo.toml"
"sea-orm-migration/Cargo.toml"
"sea-orm-rocket/Cargo.toml"
)
for target in "${targets[@]}"; do
echo "cargo +nightly fmt --manifest-path ${target} --all"
cargo +nightly fmt --manifest-path "${target}" --all
done
examples=(`find examples -type f -name 'Cargo.toml'`)
for example in "${examples[@]}"; do
echo "cargo +nightly fmt --manifest-path ${example} --all"
cargo +nightly fmt --manifest-path "${example}" --all
done
slmd COMMUNITY.md -oi
else
echo "Please execute this script from the repository root."
fi
@@ -0,0 +1,8 @@
rm -rf sea-orm-macros/src/strum/helpers
rm -rf sea-orm-macros/src/strum/enum_iter.rs
cp -r ../strum/strum_macros/src/helpers sea-orm-macros/src/strum/helpers
cp -r ../strum/strum_macros/src/macros/enum_iter.rs sea-orm-macros/src/strum/enum_iter.rs
sed -i 's/crate::helpers::{*/super::helpers::{/' sea-orm-macros/src/strum/enum_iter.rs
sed -i 's/parse_quote!(::strum)*/parse_quote!(sea_orm::strum)/' sea-orm-macros/src/strum/helpers/type_props.rs