This commit is contained in:
Brandon Thomas committed 2024-09-18 12:37:49 -04:00
1 parent fb7cddbac7
commit 4b29f96b90
4 files changed
+24 -4

No files matched your search

Generated
+2
View File
@@ -1776,6 +1776,8 @@ dependencies = [
"my-workspace-hack",
"serde",
"serde_derive",
"sqlx",
"tokio",
]
[[package]]
@@ -1,5 +1,9 @@
use chrono::Utc;
use sqlx::MySqlPool;
use sqlx_core::any::AnyConnectionBackend;
use sqlx_core::connection::Connection;
use sqlx::{MySqlConnection, Executor};
use errors::AnyhowResult;
+5 -2
View File
@@ -16,12 +16,15 @@ path = "src/main.rs"
normal = ["my-workspace-hack"]
[dependencies]
# Workspace hack (faster compile times)
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
# Internal
easyenv = { path = "../../../lib/easyenv" }
errors = { path = "../../../lib/errors" }
# Workspace hack (faster compile times)
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
sqlx = { version = "0.8.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
tokio = { version = "1.38.0", features = ["macros"] }
# External
anyhow = "1.0.86"
+13 -2
View File
@@ -1,12 +1,23 @@
use log::info;
use easyenv::init_all_with_default_logging;
use sqlx::{MySqlConnection, Executor, Connection};
use errors::AnyhowResult;
fn main() -> AnyhowResult<()> {
#[tokio::main]
async fn main() -> AnyhowResult<()> {
init_all_with_default_logging(None);
info!("TODO...");
let url = "mysql://storyteller:password@localhost/storyteller";
let mut conn = MySqlConnection::connect(url).await.unwrap();
// This is the method the macros use. It's hidden in the docs because it's not considered part of the stable API.
let describe = conn.describe("SELECT internal_token FROM api_tokens").await.unwrap();
println!("describe output: {:?}", describe);
assert_eq!(1,2);
Ok(())
}
}