Libmsi.Database

g GObject.Object GObject.Object Libmsi.Database Libmsi.Database GObject.Object->Libmsi.Database

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (path, flags, persist)

apply_transform (file)

commit ()

export (table, fd)

get_primary_keys (table)

import_ (path)

is_readonly ()

is_table_persistent (table)

merge (merge, table)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

flags

Libmsi.DbFlags

r/w/co

flags

outpath

str

r/w/co

outpath

path

str

r/w/co

path

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Libmsi.Database(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Libmsi.DatabaseClass

classmethod new(path, flags, persist)
Parameters:
Raises:

GLib.Error

Returns:

a new Libmsi.Database on success, None if fail.

Return type:

Libmsi.Database

Create a MSI database or open from path.

apply_transform(file)
Parameters:

file (str) – an MST transform file path

Raises:

GLib.Error

Returns:

True on success

Return type:

bool

FIXME

commit()
Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

export(table, fd)
Parameters:
  • table (str) – a table name

  • fd (int) – a file descriptor

Raises:

GLib.Error

Returns:

True on success

Return type:

bool

Writes a file containing the table data as tab separated ASCII. The format is as follows:

row1 : colname1 <tab> colname2 <tab> …. colnameN <cr> <lf> row2 : coltype1 <tab> coltype2 <tab> …. coltypeN <cr> <lf> row3 : tablename <tab> key1 <tab> key2 <tab> … keyM <cr> <lf>

Followed by the data, starting at row 1 with one row per line

row4 : data <tab> data <tab> data <tab> … data <cr> <lf>

get_primary_keys(table)
Parameters:

table (str) – an exisiting table name

Raises:

GLib.Error

Returns:

a Libmsi.Record containing the names of all the primary key columns.

Return type:

Libmsi.Record

import_(path)
Parameters:

path (str) – path to a table file

Raises:

GLib.Error

Returns:

True on success

Return type:

bool

Import a table to the database from file path.

is_readonly()
Returns:

True if the database is read-only.

Return type:

bool

is_table_persistent(table)
Parameters:

table (str) – an exisiting table name

Raises:

GLib.Error

Returns:

True if the table is persistent, False if it’s temporary

Return type:

bool

merge(merge, table)
Parameters:
Raises:

GLib.Error

Returns:

True on success

Return type:

bool

Property Details

Libmsi.Database.props.flags
Name:

flags

Type:

Libmsi.DbFlags

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

flags

Libmsi.Database.props.outpath
Name:

outpath

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

outpath

Libmsi.Database.props.path
Name:

path

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

path