Skip to content

Commit

Permalink
select_list.
Browse files Browse the repository at this point in the history
  • Loading branch information
Randall Nagy committed May 27, 2024
1 parent 1911d86 commit 5f1558a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
23 changes: 23 additions & 0 deletions SqltDAO/CodeGen01/SqlSyntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,29 @@ def code_class_template(self, text_file):
self.level.dec()
self.level.dec()

self.level.push()
result += self.level.print("''' New: Explicitly convert the SQLRow to a list. '''")
result += self.level.print("def select_list(self, sql_select):")
self.level.inc()
result += self.level.print("if self.bOpen:")
self.level.inc();
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("yield [*ref]")
self.level.dec()
result += self.level.print("except:")
self.level.inc();
result += self.level.print("pass")
self.level.dec()
self.level.dec()
result += self.level.print("return None")
result += self.level.print("")
self.level.pop()

self.level.push()
result += self.level.print("@staticmethod")
if self.order.encoding:
Expand Down
5 changes: 3 additions & 2 deletions SqltDAO/MainGUI.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
'''
Supporting namespace for generating Soft9000.com PyDAO projects.
Supporting namespace for generating Soft9000.com PyDAO Projects.
Designed to work with any installed PyDAO-9000 Package.
Enjoy!
-- Randall
'''

if True:
if __name__ == "__main__":
from SqltDAO.CodeGen01.Meta import Meta
from SqltDAO.main import Main as App
print(f'Starting "{Meta.Title()}" ...')
Expand Down

0 comments on commit 5f1558a

Please sign in to comment.