mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 17:58:55 +00:00
wip
This commit is contained in:
1 parent
fb7cddbac7
commit
4b29f96b90
4 files changed
+24
-4
No files matched your search
Generated
+2
@@ -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;
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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(())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user