MCPcopy Index your code
hub / github.com/webpy/webpy / register_database

Function register_database

web/db.py:1471–1482  ·  view source on GitHub ↗

Register a database. >>> class LegacyDB(DB): ... def __init__(self, **params): ... pass ... >>> register_database('legacy', LegacyDB) >>> db = database(dbn='legacy', db='test', user='joe', passwd='secret')

(name, clazz)

Source from the content-addressed store, hash-verified

1469
1470
1471def register_database(name, clazz):
1472 """
1473 Register a database.
1474
1475 >>> class LegacyDB(DB):
1476 ... def __init__(self, **params):
1477 ... pass
1478 ...
1479 >>> register_database('legacy', LegacyDB)
1480 >>> db = database(dbn='legacy', db='test', user='joe', passwd='secret')
1481 """
1482 _databases[name] = clazz
1483
1484
1485register_database("mysql", MySQLDB)

Callers 1

db.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected