[][src]Struct unqlite::UnQLite

pub struct UnQLite { /* fields omitted */ }

UnQLite database entry point.

UnQLite support both in-memory and on-disk database. There's several constructors:

ConstructorMeaning
create_in_memoryCreate a private, in-memory database.
create_tempCreate a private, temporary on-disk database.
createCreate if not exists, otherwise, open as read-write.
open_mmapObtain a read-only memory view of the whole database.
open_readonlyOpen the database in a read-only mode.

Implementations

impl UnQLite[src]

pub fn create<P: AsRef<str>>(filename: P) -> UnQLite[src]

Create UnQLite database as filename.

By default, the database is created in read-write mode.

Panics

Will panic if failed in creating.

Example

This example is not tested
let _ = UnQLite::create("test.db");

C

unqlite *pDb;

// on-disk database
rc = unqlite_open(&pDb,"test.db",UNQLITE_OPEN_CREATE);

// in-memory database
rc = unqlite_open(&pDb, ":mem:", UNQLITE_OPEN_MEM);

pub fn create_in_memory() -> UnQLite[src]

Create database in memory.

Equivalent to:

This example is not tested
let _ = UnQLite::create(":mem:");

Panics

Will panic if failed in creating.

pub fn create_temp() -> UnQLite[src]

A private, temporary on-disk database will be created.

This private database will be automatically deleted as soon as the database connection is closed.

Panics

Will panic if failed in creating.

C

int rc = unqlite_open("test.db", UNQLITE_OPEN_TEMP_DB);

pub fn open_mmap<P: AsRef<str>>(filename: P) -> UnQLite[src]

Obtain a read-only memory view of the whole database.

You will get significant performance improvements with this combination but your database is still read-only.

Panics

Panic if open failed.

C

unqlite_open(&pDb, "test.db", UNQLITE_OPEN_MMAP | UNQLITE_OPEN_READONLY);

pub fn open_readonly<P: AsRef<str>>(filename: P) -> UnQLite[src]

Open the database in a read-only mode.

That is, you cannot perform a store, append, commit or rollback operations with this control flag.

Always prefer to use open_mmap for readonly in disk database.

Panics

Panic too.

C

unqlite_open(&pDb, "test.db", UNQLITE_OPEN_READONLY);

Trait Implementations

impl Config for UnQLite[src]

impl Cursor for UnQLite[src]

impl Drop for UnQLite[src]

impl Jx9 for UnQLite[src]

Jx9 script compiler Interface.

fn compile<T: AsRef<[u8]>>(&self, jx9: T) -> Result<UnQLiteVm>[src]

Compile a Jx9 script to a bytecode program.

fn compile_file<P: AsRef<str>>(&self, filename: P) -> Result<UnQLiteVm>[src]

Compile a Jx9 script file to a bytecode program.

impl KV for UnQLite[src]

Key-Value Store Interface

impl Send for UnQLite[src]

impl Sync for UnQLite[src]

impl Transaction for UnQLite[src]

impl Util for UnQLite[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.