Database Module Documentation

class gsheetquery.database.Database(spreadsheet)

A class representing a database. This is the equivalent of a sheets file.

create_collection(name: str) Collection

Create a collection with @name. If the collection already exists, return the existing collection.

Parameters:

name – The name of the collection to be created.

drop_collection(name: str) None

Deletes a table with @name.

Parameters:

name – The name of the table to be deleted.

get_collection(name: str) Collection

Get a collection with @name. If the collection does not exist, create it.

Parameters:

name – The name of the collection to get.

get_name()

Return the canonical name of this database.

Returns:

The name of the database.

list_collection_names() List[str]

Return a list of the collections (sheets) in this database (spreadsheet).

Returns:

A list of the table names.