-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
127 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
docker-compose up -d | ||
sqlx migrate run --database-url "postgresql://axum-koans:axum-koans-sec@localhost:15432/axum-koans" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
"db": "PostgreSQL", | ||
"80a1e4b0af4d1342bd886c5b6a7c2ef0665e61e54c2ba1d8a7d04c95e0fc0730": { | ||
"describe": { | ||
"columns": [ | ||
{ | ||
"name": "id", | ||
"ordinal": 0, | ||
"type_info": "Int4" | ||
} | ||
], | ||
"nullable": [ | ||
false | ||
], | ||
"parameters": { | ||
"Left": [ | ||
"Varchar", | ||
"Varchar", | ||
"Varchar", | ||
"Varchar" | ||
] | ||
} | ||
}, | ||
"query": "INSERT INTO profiles (account_id, username, email, refresh_token) VALUES ($1, $2, $3, $4) RETURNING id" | ||
}, | ||
"d9db2b6c9db243005b52295e4037ce305bb1f0c0bd8afb9704ac33bee8dceede": { | ||
"describe": { | ||
"columns": [ | ||
{ | ||
"name": "id", | ||
"ordinal": 0, | ||
"type_info": "Int4" | ||
}, | ||
{ | ||
"name": "account_id", | ||
"ordinal": 1, | ||
"type_info": "Varchar" | ||
}, | ||
{ | ||
"name": "username", | ||
"ordinal": 2, | ||
"type_info": "Varchar" | ||
}, | ||
{ | ||
"name": "email", | ||
"ordinal": 3, | ||
"type_info": "Varchar" | ||
}, | ||
{ | ||
"name": "refresh_token", | ||
"ordinal": 4, | ||
"type_info": "Varchar" | ||
}, | ||
{ | ||
"name": "created_date", | ||
"ordinal": 5, | ||
"type_info": "Timestamptz" | ||
}, | ||
{ | ||
"name": "updated_date", | ||
"ordinal": 6, | ||
"type_info": "Timestamptz" | ||
} | ||
], | ||
"nullable": [ | ||
false, | ||
false, | ||
false, | ||
false, | ||
false, | ||
false, | ||
true | ||
], | ||
"parameters": { | ||
"Left": [ | ||
"Int4" | ||
] | ||
} | ||
}, | ||
"query": "SELECT * FROM profiles WHERE id = $1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
pub mod profile; | ||
use sqlx::{postgres::PgPoolOptions, Pool, Postgres}; | ||
|
||
pub async fn get_db_pool(database_url: String) -> Result<Pool<Postgres>, sqlx::Error> { | ||
PgPoolOptions::new() | ||
.max_connections(5) | ||
.connect(&database_url) | ||
.await | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pub mod database; | ||
pub mod extensions; | ||
pub mod handlers; | ||
pub mod middlewares; | ||
pub mod tables; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.