mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 16:06:08 +00:00
26 lines
653 B
Rust
26 lines
653 B
Rust
use sqlx::SqlitePool;
|
|
|
|
pub(crate) async fn seed_admin_session(pool: &SqlitePool, session_id: &str) {
|
|
sqlx::query(
|
|
"insert into admin_users (id, password_hash, created_at, updated_at) values (?, ?, ?, ?)",
|
|
)
|
|
.bind("admin_1")
|
|
.bind("hash")
|
|
.bind("2026-06-18T00:00:00Z")
|
|
.bind("2026-06-18T00:00:00Z")
|
|
.execute(pool)
|
|
.await
|
|
.unwrap();
|
|
|
|
sqlx::query(
|
|
"insert into admin_sessions (id, user_id, expires_at, created_at) values (?, ?, ?, ?)",
|
|
)
|
|
.bind(session_id)
|
|
.bind("admin_1")
|
|
.bind("2999-01-01T00:00:00Z")
|
|
.bind("2026-06-18T00:00:00Z")
|
|
.execute(pool)
|
|
.await
|
|
.unwrap();
|
|
}
|