Package dak :: Package daklib :: Module database
[show private | hide private]
[frames | no frames]

Module dak.daklib.database

Function Summary
  do_query(q)
Executes a database query q.
  get_architecture_id(architecture)
Returns database architecture_id for given architecture, caches result.
  get_archive_id(archive)
Returns database archive_id for given archive, caches result.
  get_component_id(component)
Returns database component_id for given component, caches result.
  get_files_id(filename, size, md5sum, location_id)
Returns -1, -2 or the file_id for a given combination of filename size md5sum location_id.
  get_location_id(location, component, archive)
Returns database location_id for given combination of location component archive.
  get_maintainer(maintainer_id)
Return the name of the maintainer behind maintainer_id
  get_or_set_fingerprint_id(fingerprint)
If fingerprintd does not have an entry in the fingerprint table yet, create one and return its id.
  get_or_set_keyring_id(keyring)
If keyring does not have an entry in the keyring table yet, create one and return its id.
  get_or_set_maintainer_id(maintainer)
If maintainer does not have an entry in the maintainer table yet, create one and return its id.
  get_or_set_queue_id(queue)
If queue does not have an entry in the queue_name table yet, create one and return its id.
  get_or_set_uid_id(uid)
If uid does not have an entry in the uid table yet, create one and return its id.
  get_override_type_id(type)
Returns database override_id for given override_type type, caches result.
  get_priority_id(priority)
Returns database priority_id for given priority, caches result.
  get_section_id(section)
Returns database section_id for given section, caches result.
  get_source_id(source, version)
Returns database source_id for given combination of source and version, caches result.
  get_suite_id(suite)
Returns database suite_id for given suite, caches result.
  get_suite_version(source, suite)
Returns database version for a given source in a given suite, caches result.
  get_suites(pkgname, src)
Return the suites in which pkgname is.
  init(config, sql)
database module init.
  set_files_id(filename, size, md5sum, sha1sum, sha256sum, location_id)
Insert a new entry into the files table.

Variable Summary
dict architecture_id_cache = {}
dict archive_id_cache = {}
Configuration Cnf = <Configuration object at 0x7f5a6b212570>
dict component_id_cache = {}
dict files_id_cache = {}
dict fingerprint_id_cache = {}
dict keyring_id_cache = {}
dict location_id_cache = {}
dict maintainer_cache = {}
dict maintainer_id_cache = {}
dict override_type_id_cache = {}
dict priority_id_cache = {}
pgobject projectB = <pgobject object at 0x7f5a6b25b300>
dict queue_id_cache = {}
dict section_id_cache = {}
dict source_id_cache = {}
dict suite_id_cache = {}
dict suite_version_cache = {}
dict uid_id_cache = {}

Imported modules:
sys, time, types
Function Details

do_query(q)

Executes a database query q. Writes statistics to stderr and returns the result.

get_architecture_id(architecture)

Returns database architecture_id for given architecture, caches result.

get_archive_id(archive)

Returns database archive_id for given archive, caches result.

get_component_id(component)

Returns database component_id for given component, caches result.

get_files_id(filename, size, md5sum, location_id)

Returns -1, -2 or the file_id for a given combination of
filename
size
md5sum
location_id.

The database is queried using filename and location_id, size and md5sum are for
extra checks.

Return values:
-1 - The given combination of arguments result in more (or less) than
     one result from the database
-2 - The given size and md5sum do not match the values in the database
anything else is a file_id

Result is cached.

get_location_id(location, component, archive)

Returns database location_id for given combination of location component archive.

The 3 parameters are the database ids returned by the respective "get_foo_id" functions.

The result will be cached.

get_maintainer(maintainer_id)

Return the name of the maintainer behind maintainer_id

get_or_set_fingerprint_id(fingerprint)

If fingerprintd does not have an entry in the fingerprint table yet, create one and return its id. If fingerprint already has an entry, simply return its id.

Result is cached.

get_or_set_keyring_id(keyring)

If keyring does not have an entry in the keyring table yet, create one and return its id. If keyring already has an entry, simply return its id.

Result is cached.

get_or_set_maintainer_id(maintainer)

If maintainer does not have an entry in the maintainer table yet, create one and return its id. If maintainer already has an entry, simply return its id.

Result is cached.

get_or_set_queue_id(queue)

If queue does not have an entry in the queue_name table yet, create one and return its id. If queue already has an entry, simply return its id.

Result is cached.

get_or_set_uid_id(uid)

If uid does not have an entry in the uid table yet, create one and return its id. If uid already has an entry, simply return its id.

Result is cached.

get_override_type_id(type)

Returns database override_id for given override_type type, caches result.

get_priority_id(priority)

Returns database priority_id for given priority, caches result.

get_section_id(section)

Returns database section_id for given section, caches result.

get_source_id(source, version)

Returns database source_id for given combination of source and version, caches result.

get_suite_id(suite)

Returns database suite_id for given suite, caches result.

get_suite_version(source, suite)

Returns database version for a given source in a given suite, caches result.

get_suites(pkgname, src=False)

Return the suites in which pkgname is. If src is True, query for source package, else binary.

init(config, sql)

database module init. Just sets two variables

set_files_id(filename, size, md5sum, sha1sum, sha256sum, location_id)

Insert a new entry into the files table.

Returns the new file_id

Variable Details

architecture_id_cache

Type:
dict
Value:
{}                                                                     

archive_id_cache

Type:
dict
Value:
{}                                                                     

Cnf

Type:
Configuration
Value:
<Configuration object at 0x7f5a6b212570>                               

component_id_cache

Type:
dict
Value:
{}                                                                     

files_id_cache

Type:
dict
Value:
{}                                                                     

fingerprint_id_cache

Type:
dict
Value:
{}                                                                     

keyring_id_cache

Type:
dict
Value:
{}                                                                     

location_id_cache

Type:
dict
Value:
{}                                                                     

maintainer_cache

Type:
dict
Value:
{}                                                                     

maintainer_id_cache

Type:
dict
Value:
{}                                                                     

override_type_id_cache

Type:
dict
Value:
{}                                                                     

priority_id_cache

Type:
dict
Value:
{}                                                                     

projectB

Type:
pgobject
Value:
<pgobject object at 0x7f5a6b25b300>                                    

queue_id_cache

Type:
dict
Value:
{}                                                                     

section_id_cache

Type:
dict
Value:
{}                                                                     

source_id_cache

Type:
dict
Value:
{}                                                                     

suite_id_cache

Type:
dict
Value:
{}                                                                     

suite_version_cache

Type:
dict
Value:
{}                                                                     

uid_id_cache

Type:
dict
Value:
{}                                                                     

Generated by Epydoc 2.1 on Sat Jan 24 18:08:17 2009 http://epydoc.sf.net