diff --git a/PyDAO_9000.egg-info/PKG-INFO b/PyDAO_9000.egg-info/PKG-INFO index 1dbf3e7..6925ed8 100644 --- a/PyDAO_9000.egg-info/PKG-INFO +++ b/PyDAO_9000.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: PyDAO_9000 -Version: 1.2.7 +Version: 1.2.8 Summary: 'All-In-One File' SQL Code Generator Author-email: Randall Nagy Project-URL: Homepage, https://github.com/soft9000/PyDAO diff --git a/SqltDAO/CodeGen01/Meta.py b/SqltDAO/CodeGen01/Meta.py index a8d95b6..dcbcd20 100644 --- a/SqltDAO/CodeGen01/Meta.py +++ b/SqltDAO/CodeGen01/Meta.py @@ -12,7 +12,7 @@ class Meta: PRODUCT = "PyDAO 9000" - VERSION = '1.2.7' + VERSION = '1.2.8' @staticmethod def Title(): diff --git a/SqltDAO/CodeGen01/SqlSyntax.py b/SqltDAO/CodeGen01/SqlSyntax.py index fa82534..58e9465 100644 --- a/SqltDAO/CodeGen01/SqlSyntax.py +++ b/SqltDAO/CodeGen01/SqlSyntax.py @@ -76,8 +76,8 @@ def code_class_template(self, text_file): result += self.level.print("if self.bOpen is False:") self.level.inc() result += self.level.print("self.conn = sqlite3.connect(self.db)") - result += self.level.print("self.conn.row_factory = sqlite3.Row") result += self.level.print("self.curs = self.conn.cursor()") + result += self.level.print("self.curs.row_factory = sqlite3.Row") result += self.level.print("self.bOpen = True") self.level.dec() result += self.level.print("return True") @@ -209,25 +209,19 @@ def code_class_template(self, text_file): self.level.pop() self.level.push() - result += self.level.print("''' New: Explicitly convert the SQLRow to our fields. '''") - result += self.level.print("''' Caveat: Full field selection is assumed, in natural order. '''") + result += self.level.print("''' New: Using the row_factory for |dictionary| support. '''") result += self.level.print("def select_dict(self, sql_select)->dict:") self.level.inc() result += self.level.print("if self.bOpen:") self.level.inc() + result += self.level.print("self.curs.row_factory = sqlite3.Row") result += self.level.print('self.curs.execute(sql_select)') result += self.level.print("zlist = self.curs.fetchall()") result += self.level.print("for ref in zlist:") self.level.inc() result += self.level.print("try:") self.level.inc() - result += self.level.print("result = OrderedDict(self.fields)") - result += self.level.print("for ss, tag in enumerate(result,1):") - self.level.inc() - result += self.level.print("result[tag] = ref[ss]") - self.level.dec() - result += self.level.print("result['ID'] = ref[0]") - result += self.level.print("yield result") + result += self.level.print("yield OrderedDict(ref)") self.level.dec() result += self.level.print("except:") self.level.inc() diff --git a/dist/PyDAO_9000-1.2.8-py3-none-any.whl b/dist/PyDAO_9000-1.2.8-py3-none-any.whl new file mode 100644 index 0000000..88fb452 Binary files /dev/null and b/dist/PyDAO_9000-1.2.8-py3-none-any.whl differ diff --git a/dist/pydao_9000-1.2.8.tar.gz b/dist/pydao_9000-1.2.8.tar.gz new file mode 100644 index 0000000..d3fdbc7 Binary files /dev/null and b/dist/pydao_9000-1.2.8.tar.gz differ diff --git a/pyproject.toml b/pyproject.toml index 4e03a46..cb90db7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "PyDAO_9000" -version = "1.2.7" +version = "1.2.8" authors = [ { name="Randall Nagy", email="r.a.nagy@gmail.com" }, ]