mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-31 15:39:34 +00:00
Adds new Github Action to build examples
This commit is contained in:
@@ -24,7 +24,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
println!("Starting LISTEN loop.");
|
||||
|
||||
listener.listen_all(&["chan0", "chan1", "chan2"]).await?;
|
||||
listener.listen_all(vec!["chan0", "chan1", "chan2"]).await?;
|
||||
|
||||
let mut counter = 0usize;
|
||||
loop {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
CREATE TABLE IF NOT EXISTS todos (
|
||||
id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
description TEXT NOT NULL,
|
||||
done BOOLEAN NOT NULL DEFAULT FALSE
|
||||
);
|
||||
|
||||
@@ -72,7 +72,7 @@ WHERE id = $1
|
||||
Ok(rows_affected > 0)
|
||||
}
|
||||
|
||||
async fn list_todos(pool: &mut PgPool) -> anyhow::Result<()> {
|
||||
async fn list_todos(pool: &PgPool) -> anyhow::Result<()> {
|
||||
let recs = sqlx::query!(
|
||||
r#"
|
||||
SELECT id, description, done
|
||||
|
||||
Reference in New Issue
Block a user