This file contains hidden or 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
| BRAND_NAME = Gogs | |
| RUN_USER = git | |
| RUN_MODE = prod | |
| [database] | |
| TYPE = sqlite3 | |
| HOST = 127.0.0.1:5432 | |
| NAME = gogs | |
| SCHEMA = public | |
| USER = gogs |
This file contains hidden or 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
| extern crate proc_macro; | |
| use quote::{format_ident, quote, ToTokens}; | |
| use syn::{ItemFn, LitStr}; | |
| #[proc_macro_attribute] | |
| pub fn test_sqlite( | |
| input: proc_macro::TokenStream, | |
| item: proc_macro::TokenStream, | |
| ) -> proc_macro::TokenStream { | |
| impl_test_sqlite(input.into(), item.into()).into() |
This file contains hidden or 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
| use std::process::Command; | |
| use anyhow::Result; | |
| use sqlx::{sqlite::SqlitePoolOptions, Pool, Sqlite}; | |
| async fn sqlite_migrate_as(migration_dir: &str, path_new_db: &str) -> Result<String> { | |
| let cs = format!("sqlite:{}?mode=rwc", path_new_db); | |
| let output = Command::new("cargo") |