Available versions of this document: latest release, release 4.15, release 4.14, release 4.13, release 4.12, release 4.11, release 4.10, release 4.9, release 4.8, release 4.7, release 4.6, release 4.5, release 4.4, release 4.3, release 4.2, release 4.1, release 4.0, release 3.6, release 3.5, nightly master
Reference documentation for older polymake versions: release 3.4, release 3.3, release 3.2
BigObject PolyDB::Client
from application common
A live connection to a PolyDB server. This is a starting point for all operations on the database.
Methods
Database Access
Core methods for connecting to the database and retrieving metadata.
-
get_collection(String name) Get an object representing a PolyDB collection. See here or
infofor 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.- Parameters:
Stringname: 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.- Returns:
- from extension:
- Example:
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.
- Options:
Stringsection: name of the section, default: all available sectionsStringcollection: name of the collection, default: all available collectionsIntinfo_level: 0: only names, 1: short description (default if no collection is given), 2: description, 3: description, authors, maintainers, 4: full infoBoolcolored- from extension:
-
list_collections(String section) Get a list of all collection names
- Parameters:
Stringsection: only return names of collections from the given section- Options:
Stringfilter: regular expression for more complex filtering of collection names, may not be used with filter_sections or filter_collectionsStringfilter_sections: filter for sections containing given substring, no regular expression, may not be used with filterStringfilter_collections: filter for collections containing given substring, no regular expression, may not be used with filterStringsection: only list collections below sectionBoolrecursive: recursively list all collections Think of correct escaping of special characters: \\. for a literal dot, \\w for a name character.- from extension:
-
list_sections(String section) Get a list of section names
- Parameters:
Stringsection: return names of sub-sections of the given section; by default, names of top-level sections are returned- Options:
Boolrecursive: return names of sub-sections on all levelsStringfilter: regular expression for more complex filtering of section names, may not be used with filter_sectionsStringfilter_sections: filter for sections containing given substring, no regular expression, may not be used with filterStringsection: only list sections below sectionBoolrecursive: recursively list all collections in subsections Think of correct escaping of special characters: \\. for a literal dot, \\w for a name character.- from extension:
Database Administration
Methods to manipulate the database sections or users.
-
add_user_to_collection(String user) add a user to a collection
-
change_password(String password) change own password
- Parameters:
Stringpassword: the new password- Returns:
- from extension:
-
collection_exists(String collection) checks if a collection with the given name exists in the database this tests for the corresponding roles, as the collection is only defined in the database if at least one object is inserted
- Parameters:
Stringcollection: the name of the collection- from extension:
-
create_user(String user, String password) add a user to the database
- Parameters:
Stringuser: the usernameStringpassword: the password- Options:
Boolpublic_read_access: whether the new user should have access to all public collections, default trueBoolcanChangeOwnAccount: whether the user can change his/her password and custom data- option list
create_user_options - Returns:
- from extension:
-
get_user_names get a list of all user names return ARRAY the user names
- from extension:
-
get_users(ARRAY usernames) get all users
- Parameters:
ARRAYusernames: list of usernames return HASH- from extension:
-
make_user_database_admin() create a database administrator
- Options:
Stringuser: the username- Returns:
- from extension:
-
new_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
- Options:
Stringcollection: fully qualified collection nameBoolpublic: whether the collection can be read by the default polymake user, default trueARRAYusers: an array of users that can read the collection (not necessary if collection is public)ARRAYadmin_users: an array of users that can edit the collection- from extension:
-
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(String user) remove a user from the database
- Parameters:
Stringuser: the username- Returns:
- from extension:
-
remove_user_from_collection(String user) remove a user to a collection note: access to public collections is not removed by this
-
section_exists(String section) checks if a section with the given name exists in the database this tests whether there is dicumentation for the section inserted into the database
- Parameters:
Stringsection: the name of the section- from extension:
-
set_section_doc(String section, HASH doc) Set documentation for a section
-
user_exists(String username) checks whether a user is already defined
- Parameters:
Stringusername: return Bool true on success- from extension: