|  | ATLAS Offline Software
    | 
| Public Member Functions | |
| def | resolve_folder_string (cls, folder_name, db_override=None) | 
| def | get_folder (cls, folder_name, db_override=None, read_only=True, create_function=None, also_db=False) | 
| def | resolve_db_string (cls, db_string, read_only=True) | 
| def | get_instance (cls, db_string, read_only=True, create=False) | 
| def | build_folder (cls, db, folder_name, multiversion, record) | 
| def | fetch_for_writing (cls, orig_folder_name, multiversion=True, record=None, create=False, db_override=None) | 
| Static Public Attributes | |
| dictionary | FOLDERS | 
Databases helper class. Used as a singleton. (don't instantiate) Specifies abbreviations for database connection strings and folders
Definition at line 233 of file DQUtils/python/db.py.
| def python.db.Databases.build_folder | ( | cls, | |
| db, | |||
| folder_name, | |||
| multiversion, | |||
| record | |||
| ) | 
Create `folder_name` on database instance `db`, with recordspecification `record`. Also creates folderset to which folder_name belongs if necessary.
Definition at line 415 of file DQUtils/python/db.py.
| def python.db.Databases.fetch_for_writing | ( | cls, | |
| orig_folder_name, | |||
| multiversion = True, | |||
| record = None, | |||
| create = False, | |||
| db_override = None | |||
| ) | 
Retrieve a folder for writing. Creates it if it doesn't exist.
`folder_name` specifies folder to be queried
`multiversion` specifies COOL versioning mode
`record` is a list of fields to be created in the form:
    [("<field name>", cool.StorageType.<field type>), ...]
    or if None, defaults to one Code record,
    or if isinstance(record, cool.RecordSpecification), uses this.
`create` should the database be created if it doesn't
`db_override` overrides automatic detection of database string
 
Definition at line 451 of file DQUtils/python/db.py.
| def python.db.Databases.get_folder | ( | cls, | |
| folder_name, | |||
| db_override = None, | |||
| read_only = True, | |||
| create_function = None, | |||
| also_db = False | |||
| ) | 
Retrieve a folder. The `db_override` parameter allows over-riding the
database which comes from the folder string.
Parameters:
    `folder_name` : Folder name or alias to load
    `db_override` : If specified, causes an alternate database string
            to be used.
    `read_only`   : Specifies if a read-only database connection should
            be used.
    `create_function` : If specified, function to be called in case the
                folder doesn't exist. It is passed the database
                connection.
    `also_db`     : Make the return value (db, folder)
 
Definition at line 304 of file DQUtils/python/db.py.
| def python.db.Databases.resolve_db_string | ( | cls, | |
| db_string, | |||
| read_only = True | |||
| ) | 
Take a database string - if it looks like a filename ending in ".db" then assume it is a sqlite database with that name. If the `db_string` is prepended with "WRITE|" then a writable connection is requested. If the db_string doesn't contain a "/", then "/" + DEFAULT_DBNAME is appended.
Definition at line 358 of file DQUtils/python/db.py.
| def python.db.Databases.resolve_folder_string | ( | cls, | |
| folder_name, | |||
| db_override = None | |||
| ) | 
Resolves a simplified folder URI.
Examples:   
    folder_name == "SHIFTOFL" 
will give a connection to COOLOFL_GLOBAL/COMP200
folder /GLOBAL/DETSTATUS/SHIFTOFL
    folder_name == "test.db::SHIFTOFL"
will give a connection to an sqlite database test.db
Priority:
    * Database specified in db_override
    * Database specified in `folder_name`
    * Database specified in cls.FOLDERS[folder_name]
 
Definition at line 269 of file DQUtils/python/db.py.
| 
 | static | 
Definition at line 239 of file DQUtils/python/db.py.
 1.8.18
 1.8.18