MCPcopy
hub / github.com/pallets/flask / init_db

Function init_db

examples/tutorial/flaskr/db.py:33–38  ·  view source on GitHub ↗

Clear existing data and create new tables.

()

Source from the content-addressed store, hash-verified

31
32
33def init_db():
34 """Clear existing data and create new tables."""
35 db = get_db()
36
37 with current_app.open_resource("schema.sql") as f:
38 db.executescript(f.read().decode("utf8"))
39
40
41@click.command("init-db")

Callers 2

appFunction · 0.90
init_db_commandFunction · 0.85

Calls 2

get_dbFunction · 0.85
open_resourceMethod · 0.45

Tested by 1

appFunction · 0.72