-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcreatedb.rs
48 lines (41 loc) · 1.17 KB
/
createdb.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//!
//! Rust Firebird Client
//!
//! Example of database creation
//!
#![allow(unused_variables, unused_mut)]
use rsfbclient::FbError;
fn main() -> Result<(), FbError> {
#[cfg(feature = "linking")]
let mut conn = rsfbclient::builder_native()
.with_dyn_link()
.with_remote()
.host("localhost")
.db_name("examples.fdb")
.user("SYSDBA")
.pass("masterkey")
.page_size(8 * 1024) // Optional
.dialect(rsfbclient::Dialect::D1)
.create_database()?;
#[cfg(feature = "dynamic_loading")]
let mut conn = rsfbclient::builder_native()
.with_dyn_load("./fbclient.lib")
.with_remote()
.host("localhost")
.db_name("examples.fdb")
.user("SYSDBA")
.pass("masterkey")
.page_size(16 * 1024) // Optional
.create_database()?;
#[cfg(feature = "pure_rust")]
let mut conn = rsfbclient::builder_pure_rust()
.host("localhost")
.db_name("examples.fdb")
.user("SYSDBA")
.pass("masterkey")
.page_size(16 * 1024) // Optional
.dialect(rsfbclient::Dialect::D3)
.create_database()?;
conn.close()?;
Ok(())
}