pyLodStorage 0.0.77__tar.gz → 0.0.78__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pylodstorage-0.0.77/pylodstorage.egg-info → pylodstorage-0.0.78}/PKG-INFO +1 -1
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/sql.py +7 -5
- {pylodstorage-0.0.77 → pylodstorage-0.0.78/pylodstorage.egg-info}/PKG-INFO +1 -1
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/setup.py +1 -1
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/LICENSE +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/README.md +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/__init__.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/csv.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/entity.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/jsonable.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/jsonpicklemixin.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/lod.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/mwTable.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/plot.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/query.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/sample.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/schema.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/sparql.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/storageconfig.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/tabulateCounter.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/uml.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/lodstorage/yamlablemixin.py +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/pylodstorage.egg-info/SOURCES.txt +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/pylodstorage.egg-info/dependency_links.txt +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/pylodstorage.egg-info/requires.txt +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/pylodstorage.egg-info/top_level.txt +0 -0
- {pylodstorage-0.0.77 → pylodstorage-0.0.78}/setup.cfg +0 -0
|
@@ -56,7 +56,7 @@ class SQLDB(object):
|
|
|
56
56
|
'''
|
|
57
57
|
self.c.execute(ddlCmd)
|
|
58
58
|
|
|
59
|
-
def createTable(self,listOfRecords,entityName,primaryKey=None,withDrop=False,sampleRecordCount=1,failIfTooFew=True):
|
|
59
|
+
def createTable(self,listOfRecords,entityName:str,primaryKey:str=None,withCreate:bool=True,withDrop:bool=False,sampleRecordCount=1,failIfTooFew=True):
|
|
60
60
|
'''
|
|
61
61
|
derive Data Definition Language CREATE TABLE command from list of Records by examining first recorda
|
|
62
62
|
as defining sample record and execute DDL command
|
|
@@ -68,6 +68,7 @@ class SQLDB(object):
|
|
|
68
68
|
entityName(string): the entity / table name to use
|
|
69
69
|
primaryKey(string): the key/column to use as a primary key
|
|
70
70
|
withDrop(boolean): true if the existing Table should be dropped
|
|
71
|
+
withCreate(boolean): true if the create Table command should be executed - false if only the entityInfo should be returned
|
|
71
72
|
sampleRecords(int): number of sampleRecords expected and to be inspected
|
|
72
73
|
failIfTooFew(boolean): raise an Exception if to few sampleRecords else warn only
|
|
73
74
|
Returns:
|
|
@@ -87,10 +88,11 @@ class SQLDB(object):
|
|
|
87
88
|
entityInfo=EntityInfo(sampleRecords,entityName,primaryKey,debug=self.debug)
|
|
88
89
|
if withDrop:
|
|
89
90
|
self.c.execute(entityInfo.dropTableCmd)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
if withCreate:
|
|
92
|
+
try:
|
|
93
|
+
self.c.execute(entityInfo.createTableCmd)
|
|
94
|
+
except sqlite3.OperationalError as oe:
|
|
95
|
+
raise Exception(f"createTable failed with error {oe} for {entityInfo.createTableCmd}")
|
|
94
96
|
return entityInfo
|
|
95
97
|
|
|
96
98
|
def getDebugInfo(self,record,index,executeMany):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|