daklib.dbconn¶
DB access class
@contact: Debian FTPMaster <ftpmaster@debian.org> @copyright: 2000, 2001, 2002, 2003, 2004, 2006 James Troup <james@nocrew.org> @copyright: 2008-2009 Mark Hymers <mhy@debian.org> @copyright: 2009, 2010 Joerg Jaspert <joerg@debian.org> @copyright: 2009 Mike O’Connor <stew@debian.org> @license: GNU General Public License version 2 or later
Functions
|
|
|
Returns database id for given architecture. |
|
returns database id for given archive. |
|
Returns database id for given component. |
|
Returns the component name of the newest binary package in suite_list or None if no package is found. |
|
Returns list of strings of component names. |
|
returns DBChange object for given filename. |
|
Returns a list of DSCFiles which may be empty |
|
Returns Fingerprint object for given fpr. |
|
If keyring does not have an entry in the keyrings table yet, return None If keyring already has an entry, simply return the existing |
|
|
|
Return the name of the maintainer behind maintainer_id or |
|
get component after mappings |
|
|
|
Returns (possibly empty) list of NewComment objects for the given parameters |
|
Returns Fingerprint object for given fpr. |
|
Returns Maintainer object for given maintainer name. |
|
Returns MetadataKey object for given uidname. |
|
Returns uid object for given uidname. |
|
Returns Override object for the given parameters |
|
Returns OverrideType object for given override_type. |
|
Returns PolicyQueue object for given queuename |
|
Returns dictionary of priority names -> id mappings |
|
Returns Priority object for given priority name. |
|
Returns Section object for given section name. |
|
Returns dictionary of section names -> id mappings |
|
Returns a DBSource object for a combination of source and suite_name. |
|
Returns Suite object for given suite name. |
|
Returns list of Architecture objects for given suite name. |
|
Returns list of Suite objects which given package name is in |
|
Returns list of Suite objects which given source name is in |
|
|
|
|
|
Returns |
|
This routine works on either DBBinary or DBSource objects and imports their metadata into the database |
|
Wrapper around common ".., session=None):" handling. |
Classes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
database module init. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ORMObject is a base class for all ORM classes mapped by SQLalchemy. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- class daklib.dbconn.Architecture(arch_string=None, description=None)[source]¶
- _sa_class_manager = {'arch_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'arch_string': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'created': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'modified': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
- arch_id¶
- arch_string¶
- created¶
- description¶
- modified¶
- class daklib.dbconn.BinContents(file=None, binary=None)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.BinaryMetadata(key=None, value=None, binary=None)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.Component(component_name=None)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.DBBinary(package=None, source=None, version=None, maintainer=None, architecture=None, poolfile=None, binarytype='deb', fingerprint=None)[source]¶
-
- metadata¶
A descriptor that presents a read/write view of an object attribute.
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- property proxy: MetadataProxy¶
- read_control() bytes [source]¶
Reads the control information from a binary.
- Returns:
stanza text of the control section.
- read_control_fields() TagSection [source]¶
Reads the control information from a binary and return as a dictionary.
- Returns:
fields of the control section as a dictionary.
- class daklib.dbconn.DBConn(*args, **kwargs)[source]¶
database module init.
- __createconn()¶
- __setupmappers()¶
- __setuptables()¶
- db_meta = None¶
- session(work_mem=0)[source]¶
Returns a new session object. If a work_mem parameter is provided a new transaction is started and the work_mem parameter is set for this transaction. The work_mem parameter is measured in MB. A default value will be used if the parameter is not set.
- tables = ('acl', 'acl_architecture_map', 'acl_fingerprint_map', 'acl_per_source', 'acl_per_suite', 'archive', 'bin_associations', 'bin_contents', 'binaries', 'binaries_metadata', 'build_queue', 'changelogs_text', 'changes', 'component', 'component_suite', 'config', 'dsc_files', 'external_files', 'external_overrides', 'external_signature_requests', 'extra_src_references', 'files', 'files_archive_map', 'fingerprint', 'hashfile', 'keyrings', 'maintainer', 'metadata_keys', 'new_comments', 'override', 'override_type', 'policy_queue', 'policy_queue_upload', 'policy_queue_upload_binaries_map', 'policy_queue_byhand_file', 'priority', 'signature_history', 'source', 'source_metadata', 'src_associations', 'src_contents', 'src_format', 'src_uploaders', 'suite', 'suite_acl_map', 'suite_architectures', 'suite_build_queue_copy', 'suite_permission', 'suite_src_formats', 'uid', 'version_check')¶
- tbl_architecture = Table('architecture', MetaData(), Column('created', DateTime(timezone=True), table=<architecture>, nullable=False, server_default=DefaultClause(<sqlalchemy.sql.functions.now at 0x7fc5da03b490; now>, for_update=False)), Column('modified', DateTime(timezone=True), table=<architecture>, nullable=False, server_default=DefaultClause(<sqlalchemy.sql.functions.now at 0x7fc5da03b890; now>, for_update=False)), Column('id', Integer(), table=<architecture>, primary_key=True, nullable=False), Column('arch_string', Text(), table=<architecture>, nullable=False), Column('description', Text(), table=<architecture>), schema=None)¶
- views = ('bin_associations_binaries', 'changelogs', 'newest_source', 'newest_src_association', 'package_list', 'source_suite', 'src_associations_src')¶
- class daklib.dbconn.DBSource(source=None, version=None, maintainer=None, changedby=None, poolfile=None, install_date=None, fingerprint=None)[source]¶
-
- metadata¶
A descriptor that presents a read/write view of an object attribute.
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- property proxy: MetadataProxy¶
- class daklib.dbconn.DebVersion[source]¶
- bind_processor(dialect)[source]¶
Return a conversion function for processing bind values.
Returns a callable which will receive a bind parameter value as the sole positional argument and will return a value to send to the DB-API.
If processing is not necessary, the method should return
None
.Note
This method is only called relative to a dialect specific type object, which is often private to a dialect in use and is not the same type object as the public facing one, which means it’s not feasible to subclass a
types.TypeEngine
class in order to provide an alternate_types.TypeEngine.bind_processor()
method, unless subclassing the_types.UserDefinedType
class explicitly.To provide alternate behavior for
_types.TypeEngine.bind_processor()
, implement a_types.TypeDecorator
class and provide an implementation of_types.TypeDecorator.process_bind_param()
.See also
- Parameters:
dialect – Dialect instance in use.
- result_processor(dialect, coltype)[source]¶
Return a conversion function for processing result row values.
Returns a callable which will receive a result row column value as the sole positional argument and will return a value to return to the user.
If processing is not necessary, the method should return
None
.Note
This method is only called relative to a dialect specific type object, which is often private to a dialect in use and is not the same type object as the public facing one, which means it’s not feasible to subclass a
types.TypeEngine
class in order to provide an alternate_types.TypeEngine.result_processor()
method, unless subclassing the_types.UserDefinedType
class explicitly.To provide alternate behavior for
_types.TypeEngine.result_processor()
, implement a_types.TypeDecorator
class and provide an implementation of_types.TypeDecorator.process_result_value()
.See also
- Parameters:
dialect – Dialect instance in use.
coltype – DBAPI coltype argument received in cursor.description.
- class daklib.dbconn.Fingerprint(fingerprint=None)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- exception daklib.dbconn.IntegrityError(statement, params, orig, hide_parameters=False, connection_invalidated=False, code=None, ismulti=None)[source]¶
Wraps a DB-API IntegrityError.
- code = 'gkpj'¶
- class daklib.dbconn.Keyring(*args, **kwargs)[source]¶
-
- generate_users_from_keyring(format: str, session) tuple[dict[str, tuple[int, str]], dict[int, tuple[str, str]]] [source]¶
- import_users_from_ldap(session) tuple[dict[str, tuple[int, str]], dict[int, tuple[str, str]]] [source]¶
- keys = {}¶
- class daklib.dbconn.Maintainer(name=None)[source]¶
-
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.MetadataKey(key=None)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.ORMObject[source]¶
ORMObject is a base class for all ORM classes mapped by SQLalchemy. All derived classes must implement the properties() method.
- classmethod get(primary_key, session=None)[source]¶
This is a support function that allows getting an object by its primary key.
Architecture.get(3[, session])
instead of the more verbose
session.query(Architecture).get(3)
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.Override(package=None, suite=None, component=None, overridetype=None, section=None, priority=None)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.OverrideType(overridetype=None)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.PoolFile(filename=None, filesize=-1, md5sum=None)[source]¶
-
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.Priority(priority=None, level=None)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.Section(section=None)[source]¶
- _sa_class_manager = {'created': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'modified': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'section': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'section_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
- created¶
- modified¶
- section¶
- section_id¶
- class daklib.dbconn.SignatureHistory[source]¶
- classmethod from_signed_file(signed_file: SignedFile) SignatureHistory [source]¶
signature history entry from signed file
- Parameters:
signed_file – signed file
- class daklib.dbconn.SourceMetadata(key=None, value=None, source=None)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.SrcContents(file=None, source=None)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.Suite(suite_name=None, version=None)[source]¶
-
- get_architectures(skipsrc: bool = False, skipall: bool = False) list[daklib.database.architecture.Architecture] [source]¶
Returns list of Architecture objects
- Parameters:
skipsrc – Whether to skip returning the ‘source’ architecture entry
skipall – Whether to skip returning the ‘all’ architecture entry
- Returns:
list of Architecture objects for the given name (may be empty)
- get_sources(source: str) Query [source]¶
Returns a query object representing DBSource that is part of this suite.
- Parameters:
source – source package name
- Returns:
a query of DBSource
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.Uid(uid=None, name=None)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- class daklib.dbconn.VersionCheck(*args, **kwargs)[source]¶
- properties() list[str] [source]¶
This method should be implemented by all derived classes and returns a list of the important properties. The properties ‘created’ and ‘modified’ will be added automatically. A suffix ‘_count’ should be added to properties that are lists or query objects. The most important property name should be returned as the first element in the list because it is used by repr().
- daklib.dbconn.get_active_keyring_paths(session=None) list[str] [source]¶
- Returns:
list of active keyring paths
- daklib.dbconn.get_architecture(architecture: str, session=None) Optional[Architecture] [source]¶
Returns database id for given architecture.
- Parameters:
architecture – The name of the architecture
session – Optional SQLA session object (a temporary one will be generated if not supplied)
- Returns:
Architecture object for the given arch (None if not present)
- daklib.dbconn.get_archive(archive: str, session=None) Optional[Archive] [source]¶
returns database id for given archive.
- Parameters:
archive – the name of the arhive
session – Optional SQLA session object (a temporary one will be generated if not supplied)
- Returns:
Archive object for the given name (None if not present)
- daklib.dbconn.get_component(component: str, session=None) Optional[Component] [source]¶
Returns database id for given component.
- Parameters:
component – The name of the override type
- Returns:
the database id for the given component
- daklib.dbconn.get_component_by_package_suite(package: str, suite_list: list[str], arch_list: Optional[str] = None, session=None) Optional[str] [source]¶
Returns the component name of the newest binary package in suite_list or None if no package is found. The result can be optionally filtered by a list of architecture names.
- Parameters:
package – DBBinary package name to search for
suite_list – list of suite_name items
arch_list – optional list of arch_string items that defaults to []
- Returns:
name of component or None
- daklib.dbconn.get_component_names(session=None) list[str] [source]¶
Returns list of strings of component names.
- Returns:
list of strings of component names
- daklib.dbconn.get_dbchange(filename: str, session=None) Optional[DBChange] [source]¶
returns DBChange object for given filename.
- Parameters:
filename – the name of the file
session – Optional SQLA session object (a temporary one will be generated if not supplied)
- Returns:
DBChange object for the given filename (
None
if not present)
- daklib.dbconn.get_dscfiles(dscfile_id: Optional[int] = None, source_id: Optional[int] = None, poolfile_id: Optional[int] = None, session=None) list[daklib.dbconn.DSCFile] [source]¶
Returns a list of DSCFiles which may be empty
- Parameters:
dscfile_id – the dscfile_id of the DSCFiles to find
source_id – the source id related to the DSCFiles to find
poolfile_id – the poolfile id related to the DSCFiles to find
- Returns:
Possibly empty list of DSCFiles
- daklib.dbconn.get_fingerprint(fpr: str, session=None) Optional[Fingerprint] [source]¶
Returns Fingerprint object for given fpr.
- Parameters:
fpr – The fpr to find / add
session – Optional SQL session object (a temporary one will be generated if not supplied).
- Returns:
the Fingerprint object for the given fpr or None
- daklib.dbconn.get_keyring(keyring: str, session=None) Optional[Keyring] [source]¶
If keyring does not have an entry in the keyrings table yet, return None If keyring already has an entry, simply return the existing
Keyring
- Parameters:
keyring – the keyring name
- Returns:
the
Keyring
object for this keyring
- daklib.dbconn.get_maintainer(maintainer_id: int, session=None) Optional[Maintainer] [source]¶
Return the name of the maintainer behind maintainer_id or
None
if that maintainer_id is invalid.- Parameters:
maintainer_id – the id of the maintainer
- Returns:
the Maintainer with this maintainer_id
- daklib.dbconn.get_mapped_component(component_name: str, session=None) Optional[Component] [source]¶
get component after mappings
Evaluate component mappings from ComponentMappings in dak.conf for the given component name.
- Parameters:
component_name – component name
session – database session
- Returns:
component after applying maps or
None
- daklib.dbconn.get_new_comments(policy_queue: PolicyQueue, package: Optional[str] = None, version: Optional[str] = None, comment_id: Optional[int] = None, session=None) list[daklib.dbconn.NewComment] [source]¶
Returns (possibly empty) list of NewComment objects for the given parameters
- Parameters:
package – name of the package
version – package version
comment_id – An id of a comment
session – Optional SQLA session object (a temporary one will be generated if not supplied)
- Returns:
A (possibly empty) list of NewComment objects will be returned
- daklib.dbconn.get_or_set_fingerprint(fpr: str, session=None) Fingerprint [source]¶
Returns Fingerprint object for given fpr.
If no matching fpr is found, a row is inserted.
- Parameters:
fpr – The fpr to find / add
session – Optional SQL session object (a temporary one will be generated if not supplied). If not passed, a commit will be performed at the end of the function, otherwise the caller is responsible for commiting. A flush will be performed either way.
- Returns:
the Fingerprint object for the given fpr
- daklib.dbconn.get_or_set_maintainer(name: str, session=None) Maintainer [source]¶
Returns Maintainer object for given maintainer name.
If no matching maintainer name is found, a row is inserted.
- Parameters:
name – The maintainer name to add
session – Optional SQL session object (a temporary one will be generated if not supplied). If not passed, a commit will be performed at the end of the function, otherwise the caller is responsible for commiting. A flush will be performed either way.
- Returns:
the Maintainer object for the given maintainer
- daklib.dbconn.get_or_set_metadatakey(keyname: str, session=None) MetadataKey [source]¶
Returns MetadataKey object for given uidname.
If no matching keyname is found, a row is inserted.
- Parameters:
keyname – The keyname to add
session – Optional SQL session object (a temporary one will be generated if not supplied). If not passed, a commit will be performed at the end of the function, otherwise the caller is responsible for commiting.
- Returns:
the metadatakey object for the given keyname
- daklib.dbconn.get_or_set_uid(uidname: str, session=None) Uid [source]¶
Returns uid object for given uidname.
If no matching uidname is found, a row is inserted.
- Parameters:
uidname – The uid to add
session – Optional SQL session object (a temporary one will be generated if not supplied). If not passed, a commit will be performed at the end of the function, otherwise the caller is responsible for commiting.
- Returns:
the uid object for the given uidname
- daklib.dbconn.get_override(package: str, suite: Optional[Union[str, list[str]]] = None, component: Optional[Union[str, list[str]]] = None, overridetype: Optional[Union[str, list[str]]] = None, session=None) list[daklib.dbconn.Override] [source]¶
Returns Override object for the given parameters
- Parameters:
package – The name of the package
suite – The name of the suite (or suites if a list) to limit to. If None, don’t limit. Defaults to None.
component – The name of the component (or components if a list) to limit to. If None, don’t limit. Defaults to None.
overridetype – The name of the overridetype (or overridetypes if a list) to limit to. If None, don’t limit. Defaults to None.
session – Optional SQLA session object (a temporary one will be generated if not supplied)
- Returns:
A (possibly empty) list of Override objects will be returned
- daklib.dbconn.get_override_type(override_type: str, session=None) Optional[OverrideType] [source]¶
Returns OverrideType object for given override_type.
- Parameters:
override_type – The name of the override type
session – Optional SQLA session object (a temporary one will be generated if not supplied)
- Returns:
the database id for the given override type
- daklib.dbconn.get_policy_queue(queuename: str, session=None) Optional[PolicyQueue] [source]¶
Returns PolicyQueue object for given queuename
- Parameters:
queuename – The name of the queue
session – Optional SQLA session object (a temporary one will be generated if not supplied)
- Returns:
PolicyQueue object for the given queue
- daklib.dbconn.get_priorities(session=None) dict[str, int] [source]¶
Returns dictionary of priority names -> id mappings
- Parameters:
session – Optional SQL session object (a temporary one will be generated if not supplied)
- Returns:
dictionary of priority names -> id mappings
- daklib.dbconn.get_priority(priority: str, session=None) Optional[Priority] [source]¶
Returns Priority object for given priority name.
- Parameters:
priority – The name of the priority
session – Optional SQLA session object (a temporary one will be generated if not supplied)
- Returns:
Priority object for the given priority
- daklib.dbconn.get_section(section: str, session=None) Optional[Section] [source]¶
Returns Section object for given section name.
- Parameters:
section – The name of the section
session – Optional SQLA session object (a temporary one will be generated if not supplied)
- Returns:
Section object for the given section name
- daklib.dbconn.get_sections(session=None) dict[str, int] [source]¶
Returns dictionary of section names -> id mappings
- Parameters:
session – Optional SQL session object (a temporary one will be generated if not supplied)
- Returns:
dictionary of section names -> id mappings
- daklib.dbconn.get_source_in_suite(source: str, suite_name: Optional[str], session=None) Optional[DBSource] [source]¶
Returns a DBSource object for a combination of source and suite_name.
- Parameters:
source – source package name
suite_name – the suite name
- Returns:
the version for source in suite
- daklib.dbconn.get_suite(suite: str, session=None) Optional[Suite] [source]¶
Returns Suite object for given suite name.
- Parameters:
suite – The name of the suite
session – Optional SQLA session object (a temporary one will be generated if not supplied)
- Returns:
Suite object for the requested suite name (None if not present)
- daklib.dbconn.get_suite_architectures(suite: str, skipsrc: bool = False, skipall: bool = False, session=None) list[daklib.database.architecture.Architecture] [source]¶
Returns list of Architecture objects for given suite name. The list is empty if suite does not exist.
- Parameters:
suite – Suite name to search for
skipsrc – Whether to skip returning the ‘source’ architecture entry
skipall – Whether to skip returning the ‘all’ architecture entry
session – Optional SQL session object (a temporary one will be generated if not supplied)
- Returns:
list of Architecture objects for the given name (may be empty)
- daklib.dbconn.get_suites_binary_in(package: str, session=None) list[daklib.dbconn.Suite] [source]¶
Returns list of Suite objects which given package name is in
- Parameters:
package – DBBinary package name to search for
- Returns:
list of Suite objects for the given package
- daklib.dbconn.get_suites_source_in(source: str, session=None) list[daklib.dbconn.Suite] [source]¶
Returns list of Suite objects which given source name is in
- Parameters:
source – DBSource package name to search for
- Returns:
list of Suite objects for the given source
- daklib.dbconn.get_version_checks(suite_name: str, check: Optional[str] = None, session=None) list[daklib.dbconn.VersionCheck] [source]¶
- daklib.dbconn.has_new_comment(policy_queue: PolicyQueue, package: str, version: str, session=None) bool [source]¶
Returns
True
if the given combination of package, version has a comment.- Parameters:
package – name of the package
version – package version
session – Optional SQLA session object (a temporary one will be generated if not supplied)
- daklib.dbconn.import_metadata_into_db(obj: Union[DBBinary, DBSource], session=None) None [source]¶
This routine works on either DBBinary or DBSource objects and imports their metadata into the database
- daklib.dbconn.session_wrapper(fn)[source]¶
Wrapper around common “.., session=None):” handling. If the wrapped function is called without passing ‘session’, we create a local one and destroy it when the function ends.
Also attaches a commit_or_flush method to the session; if we created a local session, this is a synonym for session.commit(), otherwise it is a synonym for session.flush().