You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
353 B
14 lines
353 B
3 years ago
|
use sqlx::{Any, Pool};
|
||
|
|
||
|
mod entity;
|
||
|
|
||
|
#[tokio::main]
|
||
|
async fn main() {
|
||
|
let record = entity::Entity::new(1, "Something");
|
||
|
let pool =
|
||
|
Pool::<Any>::connect(&std::env::var("DATABASE_URL").expect("I need DATABASE_URL set!"))
|
||
|
.await
|
||
|
.expect("Failed to connect to the database");
|
||
|
record.save(&pool).await.unwrap();
|
||
|
}
|