Skip to content

Cli

init_db()

Creates the query_doi and query_doi_stat tables used by this extension.

Source code in ckanext/query_dois/cli.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@query_dois.command(name='initdb')
def init_db():
    """
    Creates the `query_doi` and `query_doi_stat` tables used by this extension.
    """
    # create the 2 tables if they don't already exist
    for table in (query_doi_table, query_doi_stat_table):
        if not table.exists(model.meta.engine):
            table.create(model.meta.engine)
            click.secho('Created "{}" table'.format(table), fg='green')
        else:
            click.secho(
                'Table "{}" already exists, skipping...'.format(table), fg='green'
            )

query_dois()

Query DOIs CLI.

Source code in ckanext/query_dois/cli.py
16
17
18
19
20
21
@click.group()
def query_dois():
    """
    Query DOIs CLI.
    """
    pass