MCPcopy Create free account
hub / github.com/Findomain/Findomain / return_database_connection

Function return_database_connection

src/database.rs:14–29  ·  view source on GitHub ↗
(postgres_connection: &str)

Source from the content-addressed store, hash-verified

12
13#[must_use]
14pub fn return_database_connection(postgres_connection: &str) -> Client {
15 // Lets accept self signed certificates
16 let connector = TlsConnector::builder()
17 .danger_accept_invalid_certs(true)
18 .build()
19 .unwrap();
20 let tls_connector = MakeTlsConnector::new(connector);
21
22 match Client::connect(postgres_connection, tls_connector) {
23 Ok(client) => client,
24 Err(e) => {
25 println!("The following error happened while connecting to the database: {e}");
26 std::process::exit(1)
27 }
28 }
29}
30
31pub fn prepare_database(postgres_connection: &str) -> Result<()> {
32 let mut connection: postgres::Client = return_database_connection(postgres_connection);

Callers 7

test_database_connectionFunction · 0.85
subdomains_alertsFunction · 0.85
send_webhook_alertFunction · 0.85
prepare_databaseFunction · 0.85
query_findomain_databaseFunction · 0.85
reset_databaseFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_database_connectionFunction · 0.68