MCPcopy Create free account
hub / github.com/daniel2005d/mapXplore / create_database

Method create_database

database/PostgreSQL.py:216–222  ·  view source on GitHub ↗
(self, dbname:str)

Source from the content-addressed store, hash-verified

214 If database exists, drop and create
215 """
216 def create_database(self, dbname:str):
217 self._execute(f'DROP DATABASE IF EXISTS {dbname.lower()}')
218
219 dbexists = self._check_exists_db(dbname)
220 if not dbexists:
221 create_db = f'CREATE DATABASE "{dbname.lower()}" WITH OWNER={self.username} TEMPLATE template0'
222 self._execute(create_db)
223
224 def create_table(self, name:str, columns=None):
225 try:

Callers

nothing calls this directly

Calls 2

_executeMethod · 0.95
_check_exists_dbMethod · 0.95

Tested by

no test coverage detected