from application common
A live connection to a PolyDB server. This is a starting point for all operations on the database.
Core methods for connecting to the database and retrieving metadata.
change_password
get_collection(String name)
Get an object representing a PolyDB collection. See here or info
for available sections and collections. Please be aware that some collections may have restricted access rights. The permission is not checked immediately in this function but when real data are accessed first time.
String
name
: collection name If there are several collections with equal names in different sections, the full name including the section name must be given. Custom variable $PolyDB::default::db_section_name can be set to the most frequently used section name, then it will be taken into account for disambiguation. Custom variable $PolyDB::default::db_collection_name can be set as a default value for this parameter.
Get a collection specified by a full name
> $coll_smooth = $polyDB->get_collection("Polytope.Lattice.SmoothReflexive");
Get a collection specified by a short name, as long as it's unambiguous
> $coll_fano = $polyDB->get_collection("Fano");
info()
Print information about available databases and collections.
String
section
: name of the database, default: all available databases
String
collection
: name of the collection, default: all available collections
Int
info_level
: 0: only names, 1: short description (default if no collection is given), 2: description, 3: description, authors, maintainers, 4: full info
Bool
colored
list_collections(String section)
Get a list of all collection names
list_sections(String section)
Get a list of section names
String
section
: return names of sub-sections of the given section; by default, names of top-level sections are returned
Bool
recursive
: return names of sub-sections on all levels
String
filter
: regular expression for more complex filtering of section names Think of correct escaping of special characters: \\. for a literal dot, \\w for a name character.
Methods to manipulate the database sections or users.
add_user_to_collection()
add a user to a collection
create_database_admin()
create a database administrator
create_user()
create a new user
create_user_options
get_users(ARRAY usernames)
get all users
ARRAY
usernames
: list of usernames return HASH
initiate_collection()
Starts a new collection by creating the necessary roles and distributing them to the appropriate users and adding it to the default polymakeUser role if the collection is public
String
section
: section
String
collection
: collection
Bool
public
: whether the collection can be read by the default polymake user, default true
ARRAY
admin_users
: an array of users that can edit the collection
ARRAY
users
: an array of users that can read the collection (not necessary if collection is public)
remove_collection()
Remove a collection toegther with its documentation and the associated rules
remove_section()
Remove a section toegther with its documentation The section must be empty, i.e. no subsections and no collections
remove_user_from_collection()
remove a user to a collection note: access to public collections is not removed by this
set_section_doc(HASH doc)
Set documentation for a section
HASH
doc
: the documentation
doc_options