mononoke/sql_ext: add mysql connections

Summary: The diff adds API to create a set of connections: read, read master and write.

Reviewed By: ahornby

Differential Revision: D23568561

fbshipit-source-id: b3ee954604557497ed56c6b369256b6f76a1e042
This commit is contained in:
Aida Getoeva 2020-09-28 08:11:52 -07:00 committed by Facebook GitHub Bot
parent 77c2ae3673
commit 0ba6f9ff35
3 changed files with 15 additions and 3 deletions

View File

@ -10,6 +10,7 @@ include = ["src/**/*.rs"]
fbinit = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
futures_ext = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
sql = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
sql_common = { git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
anyhow = "1.0"
async-trait = "0.1.29"
futures-old = { package = "futures", version = "0.1" }

View File

@ -44,15 +44,15 @@ pub mod facebook {
#[cfg(fbcode_build)]
pub use r#impl::{
create_myrouter_connections, create_raw_xdb_connections,
create_myrouter_connections, create_mysql_connections, create_raw_xdb_connections,
myadmin::{MyAdmin, MyAdminLagMonitor},
myrouter_ready,
};
#[cfg(not(fbcode_build))]
pub use crate::oss::{
create_myrouter_connections, create_raw_xdb_connections, myrouter_ready, MyAdmin,
MyAdminLagMonitor,
create_myrouter_connections, create_mysql_connections, create_raw_xdb_connections,
myrouter_ready, MyAdmin, MyAdminLagMonitor,
};
#[derive(Copy, Clone, Debug)]

View File

@ -43,6 +43,17 @@ pub fn create_myrouter_connections(
fb_unimplemented!()
}
pub fn create_mysql_connections(
_fb: FacebookInit,
_tier: String,
_shard_id: Option<usize>,
_read_con_type: ReadConnectionType,
_pool_size_config: PoolSizeConfig,
_readonly: bool,
) -> Result<SqlConnections, Error> {
fb_unimplemented!()
}
pub fn myrouter_ready(
db_addr_opt: Option<String>,
mysql_options: MysqlOptions,