From 2edda5c7b4e4a4292c212e4698a00bb525ce4a01 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 28 May 2010 10:34:59 -0500 Subject: [PATCH 02/13] Bumped version to 0.1b2. --- sqlbase7_sa/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlbase7_sa/_version.py b/sqlbase7_sa/_version.py index 729541a..419df1a 100644 --- a/sqlbase7_sa/_version.py +++ b/sqlbase7_sa/_version.py @@ -23,4 +23,4 @@ ################################################################################ -__version__ = '0.1b1' +__version__ = '0.1b2' From 2fd3f190af5e374f6ebf920d6dbee4e3147fae1b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 28 May 2010 11:29:49 -0500 Subject: [PATCH 04/13] Bumped version to 0.1b3. --- sqlbase7_sa/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlbase7_sa/_version.py b/sqlbase7_sa/_version.py index 419df1a..daf0c55 100644 --- a/sqlbase7_sa/_version.py +++ b/sqlbase7_sa/_version.py @@ -23,4 +23,4 @@ ################################################################################ -__version__ = '0.1b2' +__version__ = '0.1b3' From f7c4a2c2df0950097d08702d1d16d4ad7494ab01 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 25 Jun 2010 12:58:34 -0500 Subject: [PATCH 05/13] bumped sqlalchemy requirement It's been discovered that SQLAlchemy 0.5.2 won't work; some problem with joining the sales log tables. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index eb6ec34..c3b5602 100644 --- a/setup.py +++ b/setup.py @@ -66,7 +66,7 @@ specific version of this database, that version being 7.5.1. packages = find_packages(), install_requires = [ - 'SQLAlchemy', + 'SQLAlchemy>0.5.2', ], entry_points = { From 8846e9b3725d080345f775c2a63682ba3efa6cdf Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 25 Jun 2010 13:01:15 -0500 Subject: [PATCH 07/13] bumped version --- sqlbase7_sa/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlbase7_sa/_version.py b/sqlbase7_sa/_version.py index daf0c55..9edf306 100644 --- a/sqlbase7_sa/_version.py +++ b/sqlbase7_sa/_version.py @@ -23,4 +23,4 @@ ################################################################################ -__version__ = '0.1b3' +__version__ = '0.1b4' From 3ee47ed87f2289ea39b5ad68f0c9a90a0b0dda5e Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 31 Jul 2010 20:09:17 -0500 Subject: [PATCH 08/13] added outer join support...michael was right :) And once again, thanks to Michael Bayer for forging the way on this one. The Oracle dialect code was still pretty much copied directly over. --- sqlbase7_sa/sqlbase7.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/sqlbase7_sa/sqlbase7.py b/sqlbase7_sa/sqlbase7.py index 93c8ef3..690395c 100644 --- a/sqlbase7_sa/sqlbase7.py +++ b/sqlbase7_sa/sqlbase7.py @@ -26,6 +26,7 @@ from sqlalchemy.engine.default import DefaultDialect from sqlalchemy import types, and_ from sqlalchemy.sql.expression import Join +from sqlalchemy.sql import visitors, operators, ClauseElement import sqlalchemy @@ -56,7 +57,12 @@ class SQLBase7Compiler(CompilerBase): return self.process(join.left, **kwargs) + ", " + self.process(join.right, **kwargs) def visit_select(self, select, **kwargs): - froms = select._get_display_froms() + if self.stack and 'from' in self.stack[-1]: + existingfroms = self.stack[-1]['from'] + else: + existingfroms = None + + froms = select._get_display_froms(existingfroms) whereclause = self._get_join_whereclause(froms) if whereclause is not None: select = select.where(whereclause) @@ -71,7 +77,16 @@ class SQLBase7Compiler(CompilerBase): clauses = [] def visit_join(join): - clauses.append(join.onclause) + if join.isouter: + def visit_binary(binary): + if binary.operator == operators.eq: + if binary.left.table is join.right: + binary.left = _OuterJoinColumn(binary.left) + elif binary.right.table is join.right: + binary.right = _OuterJoinColumn(binary.right) + clauses.append(visitors.cloned_traverse(join.onclause, {}, {'binary':visit_binary})) + else: + clauses.append(join.onclause) for j in join.left, join.right: if isinstance(j, Join): visit_join(j) @@ -84,6 +99,16 @@ class SQLBase7Compiler(CompilerBase): return and_(*clauses) return None + def visit_outer_join_column(self, vc): + return self.process(vc.column) + "(+)" + + +class _OuterJoinColumn(ClauseElement): + __visit_name__ = 'outer_join_column' + + def __init__(self, column): + self.column = column + class SQLBase7Dialect(DefaultDialect): From 756f0a8e5d54fb2d2a8c15ba85ec7effe31a0a10 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 31 Jul 2010 20:15:49 -0500 Subject: [PATCH 10/13] bumped version --- sqlbase7_sa/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlbase7_sa/_version.py b/sqlbase7_sa/_version.py index 9edf306..5bb4149 100644 --- a/sqlbase7_sa/_version.py +++ b/sqlbase7_sa/_version.py @@ -23,4 +23,4 @@ ################################################################################ -__version__ = '0.1b4' +__version__ = '0.1b5' From bd74701c42b4b83910fefd1c4489c33d5015ef49 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 6 Oct 2025 14:05:17 -0500 Subject: [PATCH 11/13] add readme file, to replace old home page which was at https://sqlalchemy-sa.edbob.org --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c64eef9 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ + +# SQLBase7-SA + +SQLBase7-SA is a SQLAlchemy driver/dialect for the Centura SQLBase +database, specifically version 7.5.1. + +## About the Project + +From what I can tell, SQLBase is still an actively-developed database, +but it is no longer owned by Centura (see +[here](http://en.wikipedia.org/wiki/Gupta_Technologies)). Also, the +current version (according to [this +page](http://www.unify.com/Products/Data_Management/SQLBase/), as of +25 Apr 2010) is 11.5, so I have no idea how useful this project will +be for versions of SQLBase more recent than 7.5.1. + +This project exists only for the sake of providing read-only access to +legacy data, specifically that used by the +[CAM32](http://www.camcommerce.com/products/CAM32.aspx) Point of Sale +software. It's possible that it could allow writing data, etc., but I +personally won't be adding any such features unless/until the need +arises. + +I don't expect there to be much of anyone using SQLBase 7.5.1 at this +point (besides perhaps other CAM32 users), but if you do happen to +need additional functionality from this project or just have questions +or comments, feel free to drop me a line at lance@edbob.org. + +## Downloads + +The code is released under the [GNU General Public +License](http://www.gnu.org/licenses/gpl.html), version 3. + +It is available at [PyPI](http://pypi.python.org/pypi/SQLBase7-SA), so +the easiest way to get the package is with the command: + + # pip install SQLBase7-SA + +Again, this project is extremely specific to my needs, so I'm only +building eggs for Python 2.5 and 2.6 at this point. If you happen to +need something else then please contact me. + +Copyright © 2010 Lance Edgar From dafac32f9432fb16b7a9f477012828d7df836ce4 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 6 Oct 2025 14:10:35 -0500 Subject: [PATCH 12/13] update home page URL for project --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c3b5602..2129140 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ setup( version = __version__, author = 'Lance Edgar', author_email = 'lance@edbob.org', - url = "http://sqlbase7-sa.edbob.org/", + url = "https://forgejo.wuttaproject.org/rattail/sqlbase7-sa", license = "GNU GPL v3", description = 'SQLAlchemy dialect for Centura SQLBase v7', long_description = """ From b4c4d1bb26fe424d575fca0c6c834547f18c5e66 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 6 Oct 2025 14:11:42 -0500 Subject: [PATCH 13/13] use unix line endings for setup.py --- setup.py | 172 +++++++++++++++++++++++++++---------------------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/setup.py b/setup.py index 2129140..75395a7 100644 --- a/setup.py +++ b/setup.py @@ -1,86 +1,86 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -################################################################################ -# -# SQLBase7-SA -- SQLAlchemy driver/dialect for Centura SQLBase v7 -# Copyright © 2010 Lance Edgar -# -# This file is part of SQLBase7-SA. -# -# SQLBase7-SA is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# SQLBase7-SA is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with SQLBase7-SA. If not, see . -# -################################################################################ - - -from setuptools import setup, find_packages - - -import os -execfile(os.path.join(os.path.dirname(__file__), 'sqlbase7_sa', '_version.py')) - - -setup( - name = 'SQLBase7-SA', - version = __version__, - author = 'Lance Edgar', - author_email = 'lance@edbob.org', - url = "https://forgejo.wuttaproject.org/rattail/sqlbase7-sa", - license = "GNU GPL v3", - description = 'SQLAlchemy dialect for Centura SQLBase v7', - long_description = """ -SQLBase7-SA - SQLAlchemy dialect for Centura SQLBase v7 -------------------------------------------------------- - -This package provides a (possibly rudimentary) implementation -of a SQLAlchemy dialect for the Centura SQLBase database -engine. It is only intended (and known) to work with a very -specific version of this database, that version being 7.5.1. -""", - - classifiers = [ - 'Development Status :: 4 - Beta', - 'Environment :: Plugins', - 'Environment :: Win32 (MS Windows)', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Natural Language :: English', - 'Operating System :: Microsoft :: Windows', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.5', - 'Programming Language :: Python :: 2.6', - 'Topic :: Database', - 'Topic :: Software Development :: Libraries :: Python Modules', - ], - - packages = find_packages(), - - install_requires = [ - 'SQLAlchemy>0.5.2', - ], - - entry_points = { - - # SQLAlchemy 0.5 - 'sqlalchemy.databases' : [ - 'sqlbase7 = sqlbase7_sa.sqlbase7_sa05:SQLBase7Dialect_SA05', - ], - - # SQLAlchemy 0.6 - 'sqlalchemy.dialects' : [ - 'sqlbase7 = sqlbase7_sa.sqlbase7_sa06:SQLBase7Dialect_SA06_pyodbc', - ], - }, - - test_suite = 'sqlbase7_sa.tests', - ) +#!/usr/bin/env python +# -*- coding: utf-8 -*- +################################################################################ +# +# SQLBase7-SA -- SQLAlchemy driver/dialect for Centura SQLBase v7 +# Copyright © 2010 Lance Edgar +# +# This file is part of SQLBase7-SA. +# +# SQLBase7-SA is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# SQLBase7-SA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with SQLBase7-SA. If not, see . +# +################################################################################ + + +from setuptools import setup, find_packages + + +import os +execfile(os.path.join(os.path.dirname(__file__), 'sqlbase7_sa', '_version.py')) + + +setup( + name = 'SQLBase7-SA', + version = __version__, + author = 'Lance Edgar', + author_email = 'lance@edbob.org', + url = "https://forgejo.wuttaproject.org/rattail/sqlbase7-sa", + license = "GNU GPL v3", + description = 'SQLAlchemy dialect for Centura SQLBase v7', + long_description = """ +SQLBase7-SA - SQLAlchemy dialect for Centura SQLBase v7 +------------------------------------------------------- + +This package provides a (possibly rudimentary) implementation +of a SQLAlchemy dialect for the Centura SQLBase database +engine. It is only intended (and known) to work with a very +specific version of this database, that version being 7.5.1. +""", + + classifiers = [ + 'Development Status :: 4 - Beta', + 'Environment :: Plugins', + 'Environment :: Win32 (MS Windows)', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: GNU General Public License (GPL)', + 'Natural Language :: English', + 'Operating System :: Microsoft :: Windows', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2.5', + 'Programming Language :: Python :: 2.6', + 'Topic :: Database', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], + + packages = find_packages(), + + install_requires = [ + 'SQLAlchemy>0.5.2', + ], + + entry_points = { + + # SQLAlchemy 0.5 + 'sqlalchemy.databases' : [ + 'sqlbase7 = sqlbase7_sa.sqlbase7_sa05:SQLBase7Dialect_SA05', + ], + + # SQLAlchemy 0.6 + 'sqlalchemy.dialects' : [ + 'sqlbase7 = sqlbase7_sa.sqlbase7_sa06:SQLBase7Dialect_SA06_pyodbc', + ], + }, + + test_suite = 'sqlbase7_sa.tests', + )