Package entropy :: Package db :: Module mysql :: Class EntropyMySQLRepository

Class EntropyMySQLRepository

source code


EntropyMySQLRepository implements MySQL based storage. In a Model-View based design pattern, this can be considered the "model".

Nested Classes
  MySQLSchema
  MySQLProxy
  Schema
  ModuleProxy
Instance Methods
 
__init__(self, uri, readOnly=False, xcache=False, name=None, indexing=True, skipChecks=False, direct=False)
EntropyMySQLRepository constructor.
source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
__unicode__(self) source code
 
close(self, safe=False)
Reimplemented from EntropyRepositoryBase.
source code
 
vacuum(self)
Reimplemented from EntropyRepositoryBase.
source code
 
initializeRepository(self)
Reimplemented from EntropyRepositoryBase.
source code
 
setSpmUid(self, package_id, spm_package_uid, branch=None)
Reimplemented from EntropySQLRepository.
source code
 
handlePackage(self, pkg_data, revision=None, formattedContent=False)
Reimplemented from EntropySQLRepository.
source code
 
integrity_check(self)
Reimplemented from EntropyRepositoryBase.
source code
 
exportRepository(self, dumpfile)
Reimplemented from EntropyRepositoryBase.
source code
float
mtime(self)
Reimplemented from EntropyRepositoryBase.
source code
 
dropAllIndexes(self)
Reimplemented from EntropyRepositoryBase.
source code

Inherited from sql.EntropySQLRepository: acceptLicense, addPackage, addRepositoryUpdatesActions, arePackageIdsAvailable, bumpTreeUpdatesActions, checksum, clean, clearCache, clearPackageSets, clearTreeupdatesEntries, commit, contentDiff, createAllIndexes, dropChangelog, dropContent, dropContentSafety, dropGpgSignatures, dropInstalledPackageFromStore, getApi, getBaseData, getDependency, getFakeSpmUid, getInstalledPackageRepository, getInstalledPackageSource, getPackageIdFromDownload, getPackageIds, getScopeData, getSetting, getStrictData, getStrictScopeData, getVersioningData, insertAutomergefiles, insertBranchMigration, insertConflicts, insertContent, insertDependencies, insertPackageSets, insertPreservedLibrary, insertSpmUid, insertTreeUpdatesActions, isBranchMigrationAvailable, isFileAvailable, isInjected, isLicenseAccepted, isLicenseDataKeyAvailable, isPackageIdAvailable, isPackageScopeAvailable, isSpmUidAvailable, isSpmUidTrashed, isSystemPackage, listAllCategories, listAllDependencies, listAllDownloads, listAllExtraDownloads, listAllFiles, listAllInjectedPackageIds, listAllPackageIds, listAllPackages, listAllPreservedLibraries, listAllSpmUids, listAllSystemPackageIds, listAllTrashedSpmUids, listAllTreeUpdatesActions, listConfigProtectEntries, listPackageIdsInCategory, moveSpmUidsToBranch, regenerateSpmUidMapping, removeConflicts, removeDependencies, removePackage, removePreservedLibrary, removeTrashedUids, removeTreeUpdatesActions, resetTreeupdatesDigests, resolveNeeded, retrieveApi, retrieveAtom, retrieveAutomergefiles, retrieveBranch, retrieveBranchMigration, retrieveBuildDependencies, retrieveCategory, retrieveCategoryDescription, retrieveChangelog, retrieveChangelogByKey, retrieveCompileFlags, retrieveConflicts, retrieveContent, retrieveContentIter, retrieveContentSafety, retrieveContentSafetyIter, retrieveCreationDate, retrieveDependencies, retrieveDependenciesList, retrieveDescription, retrieveDesktopMime, retrieveDigest, retrieveDownloadURL, retrieveExtraDownload, retrieveHomepage, retrieveKeySlot, retrieveKeySlotAggregated, retrieveKeySlotTag, retrieveKeySplit, retrieveKeywords, retrieveLicense, retrieveLicenseData, retrieveLicenseDataKeys, retrieveLicenseText, retrieveManualDependencies, retrieveMirrorData, retrieveName, retrieveNeeded, retrieveNeededLibraries, retrieveOnDiskSize, retrievePackageSet, retrievePackageSets, retrievePostDependencies, retrievePreservedLibraries, retrieveProtect, retrieveProtectMask, retrieveProvide, retrieveProvidedLibraries, retrieveProvidedMime, retrieveRepositoryUpdatesDigest, retrieveReverseDependencies, retrieveRevision, retrieveRuntimeDependencies, retrieveSignatures, retrieveSize, retrieveSlot, retrieveSources, retrieveSpmMetadata, retrieveSpmPhases, retrieveSpmRepository, retrieveSpmUid, retrieveTag, retrieveTreeUpdatesActions, retrieveTrigger, retrieveUnusedPackageIds, retrieveUseflags, retrieveVersion, rollback, searchBelongs, searchCategory, searchConflict, searchContentSafety, searchDependency, searchDescription, searchHomepage, searchKeySlot, searchKeySlotTag, searchLicense, searchName, searchNameCategory, searchNeeded, searchPackageIdFromDependencyId, searchPackages, searchProvidedMime, searchProvidedVirtualPackage, searchRevisionedPackages, searchSets, searchSimilarPackages, searchSlotted, searchTaggedPackages, searchUseflag, setAtom, setBranchMigrationPostUpgradeMd5sum, setCategory, setCategoryDescription, setContentSafety, setCreationDate, setDependency, setDigest, setDownloadURL, setIndexing, setInjected, setInstalledPackageSource, setName, setRepositoryUpdatesDigest, setRevision, setSignatures, setSlot, setTrashedUid, storeInstalledPackage, storeSpmMetadata, switchBranch, validate

Inherited from skel.EntropyRepositoryBase: acquire_exclusive, acquire_shared, alignDatabases, atomMatch, atomMatchCacheKey, cache_policy, cache_policy_all, cache_policy_none, caching, direct, directed, exclusive, filterTreeUpdatesActions, getPackageData, getPackageXmlData, getPackagesToRemove, getTriggerData, lock_path, maskFilter, readonly, release_exclusive, release_shared, repository_id, runTreeUpdatesActions, shared, temporary, try_acquire_exclusive, try_acquire_shared

Inherited from skel.EntropyRepositoryPluginStore: add_plugin, get_plugin_metadata, get_plugins, get_plugins_metadata, remove_plugin, set_plugin_metadata

Inherited from core.EntropyPluginStore: drop_plugins, has_plugin

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods

Inherited from sql.EntropySQLRepository: isMainThread

Inherited from output.TextInterface: ask_question, edit_file, input_box, output, set_title

Static Methods
int
importRepository(dumpfile, db, data=None)
Reimplemented from EntropyRepositoryBase.
source code

Inherited from sql.EntropySQLRepository: remote_revision, revision, update

Inherited from skel.EntropyRepositoryPluginStore: add_permanent_plugin, get_permanent_plugins, remove_permanent_plugin

Class Variables

Inherited from sql.EntropySQLRepository: GENERIC_NAME

Inherited from skel.EntropyRepositoryBase: REPOSITORY_ALREADY_UPTODATE, REPOSITORY_CHECKSUM_ERROR, REPOSITORY_GENERIC_ERROR, REPOSITORY_NOT_AVAILABLE, REPOSITORY_PERMISSION_DENIED_ERROR, REPOSITORY_UPDATED_OK, SETTING_KEYS, VIRTUAL_META_PACKAGE_CATEGORY

Inherited from output.TextInterface: OUTPUT_LOCK

Properties

Inherited from object: __class__

Method Details

__init__(self, uri, readOnly=False, xcache=False, name=None, indexing=True, skipChecks=False, direct=False)
(Constructor)

source code 

EntropyMySQLRepository constructor.

Parameters:
  • uri (string) - the connection URI
  • readOnly (bool) - open file in read-only mode
  • xcache (bool) - enable on-disk cache
  • name (string) - repository identifier
  • indexing (bool) - enable database indexes
  • skipChecks (bool) - if True, skip integrity checks
  • direct (bool) - True, if direct mode should be always enabled
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

close(self, safe=False)

source code 

Reimplemented from EntropyRepositoryBase. Needs to call superclass method.

Parameters:
  • safe - if True, the MainThread resources won't be released. This is vital if both MainThread and a random thread access the Repository concurrently. With safe=False (original behaviour) MainThread cursors may become invalid and cause random exceptions in a racey fashion. But on the other hand, if closing all the resources is what is really wanted, safe must be False, or the MainThread ones will be never released.
Overrides: skel.EntropyRepositoryBase.close

vacuum(self)

source code 

Reimplemented from EntropyRepositoryBase.

Overrides: skel.EntropyRepositoryBase.vacuum

To Do: should it run OPTIMIZE TABLE for each table?

initializeRepository(self)

source code 

Reimplemented from EntropyRepositoryBase.

Overrides: skel.EntropyRepositoryBase.initializeRepository

setSpmUid(self, package_id, spm_package_uid, branch=None)

source code 

Reimplemented from EntropySQLRepository. Specialized version that only handles UNIQUE constraint violations.

Parameters:
  • package_id - package indentifier
  • spm_package_uid - Source package Manager unique package identifier
  • branch - current Entropy repository branch
Overrides: skel.EntropyRepositoryBase.setSpmUid

handlePackage(self, pkg_data, revision=None, formattedContent=False)

source code 

Reimplemented from EntropySQLRepository.

Raises:
  • NotImplementedError - guess what, you need to implement this.
Overrides: skel.EntropyRepositoryBase.handlePackage

integrity_check(self)

source code 

Reimplemented from EntropyRepositoryBase.

Raises:
Overrides: skel.EntropyRepositoryBase.integrity_check

importRepository(dumpfile, db, data=None)
Static Method

source code 

Reimplemented from EntropyRepositoryBase.

Parameters:
  • dumpfile - dump file to read
  • dbfile - database file path or reference name
  • data - connection data (dict object)
Returns: int
import return code (0 = OK)
Raises:
  • AttributeError - if given paths are invalid
Overrides: skel.EntropyRepositoryBase.importRepository

exportRepository(self, dumpfile)

source code 

Reimplemented from EntropyRepositoryBase.

Parameters:
  • dumpfile - dump file object to write to
Overrides: skel.EntropyRepositoryBase.exportRepository

mtime(self)

source code 

Reimplemented from EntropyRepositoryBase.

Returns: float
mtime
Raises:
  • IOError - if mtime cannot be retrieved
  • OSError - if mtime cannot be retrieved (Operating System error)
Overrides: skel.EntropyRepositoryBase.mtime

dropAllIndexes(self)

source code 

Reimplemented from EntropyRepositoryBase.

Overrides: skel.EntropyRepositoryBase.dropAllIndexes