[sqlalchemy] alternative driver for firebird

2011-06-23 Thread bigt
in addition to the currently supported kinterbasdb, there is an
alternative python interface, which is relatavely new, but has the
advantage of already supporting Python3, and which is likely to become
the preferred interface when Firebird3 is released..

See http://pypi.python.org/pypi/firebirdsql/


I should like to request that sqlalchemy implement support for this
alternative interface, in the same ways as there are multiple drivers
for postgresql.


Regards

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



[sqlalchemy] support for SEQUENCE keyword in firebird

2011-03-02 Thread bigt
my Firebird database has some Sequence values defined as

CREATE SEQUENCE S_org;

with an appropriate trigger to set a value.

RECREATE TRIGGER TBI_org FOR org
 ACTIVE BEFORE INSERT POSITION 0
 AS BEGIN
IF (NEW.Id IS NULL) THEN
  NEW.Id = NEXT VALUE FOR S_org;
END^


Using reflection in sqlalchemy i get an error when trying to store an
entry in the ORG table.

  File /usr/lib/python2.7/site-packages/sqlalchemy/orm/session.py,
line 1392, in flush
self._flush(objects)
  File /usr/lib/python2.7/site-packages/sqlalchemy/orm/session.py,
line 1473, in _flush
flush_context.execute()
  File /usr/lib/python2.7/site-packages/sqlalchemy/orm/
unitofwork.py, line 302, in execute
rec.execute(self)
  File /usr/lib/python2.7/site-packages/sqlalchemy/orm/
unitofwork.py, line 446, in execute
uow
  File /usr/lib/python2.7/site-packages/sqlalchemy/orm/mapper.py,
line 1884, in _save_obj
execute(statement, params)
  File /usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py,
line 1191, in execute
params)
  File /usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py,
line 1271, in _execute_clauseelement
return self.__execute_context(context)
  File /usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py,
line 1302, in __execute_context
context.parameters[0], context=context)
  File /usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py,
line 1401, in _cursor_execute
context)
  File /usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py,
line 1394, in _cursor_execute
context)
  File /usr/lib/python2.7/site-packages/sqlalchemy/dialects/firebird/
base.py, line 680, in do_execute
cursor.execute(statement, parameters or [])
InterfaceError: (InterfaceError) (0L, Error while attempting to
convert object of type class 'sqlalchemy.schema.Sequence' to
database-internal numeric type for storage in field [name not known at
this stage of query execution].  The invalid input object is:
Sequence(u's_org', start=1, increment=1, optional=False)) 'INSERT
INTO org (id, name, contact, dept, vatnr, country, city, street,
building, postcode, phone, fax, email) VALUES
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' (Sequence(u's_org', start=1,
increment=1, optional=False), u'xyz', None, None, None, u'CH', None,
None, None, None, None, None, None)


It appears that Sqlalchemy does not process correctly  the  SEQUENCE
keyword in recent versions of Firebird

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



[sqlalchemy] bad sql generated for filter_list using firebird

2011-02-28 Thread bigt
generated sql contains invalid reference to table NONE

I don't know where the problem is in Camelot or Sqlalchemy.(latest 0.6
trunk)

I am using a Firebird database.

I think that the sql derives from the following statements

col = getattr( admin.entity, field_name )
query = select([col], distinct=True,
order_by=col.asc()).select_from(table)


ERROR:camelot.view.model_thread.signal_slot_model_thread:exception
caught in model thread while executing get_filters_and_actions -
TableView.set_filters_and_actions
Traceback (most recent call last):
  File /var/git/camelot/camelot/view/model_thread/
signal_slot_model_thread.py, line 57, in execute
result = self._request()
  File /var/git/camelot/camelot/view/controls/tableview.py, line
559, in get_filters_and_actions
return ( admin.get_filters(), admin.get_list_actions() )
  File /var/git/camelot/camelot/view/model_thread/__init__.py, line
57, in wrapper
return original_function(*args, **kwargs)
  File /var/git/camelot/camelot/admin/entity_admin.py, line 364, in
get_filters
return list(filter_generator())
  File /var/git/camelot/camelot/admin/entity_admin.py, line 362, in
filter_generator
yield (filter, filter.get_name_and_options(self))
  File /var/git/camelot/camelot/view/filters.py, line 112, in
get_name_and_options
for value in session.execute(query):
  File /usr/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py,
line 139, in do
return getattr(self.registry(), name)(*args, **kwargs)
  File /usr/lib/python2.7/site-packages/sqlalchemy/orm/session.py,
line 724, in execute
clause, params or {})
  File /usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py,
line 1191, in execute
params)
  File /usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py,
line 1271, in _execute_clauseelement
return self.__execute_context(context)
  File /usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py,
line 1302, in __execute_context
context.parameters[0], context=context)
  File /usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py,
line 1401, in _cursor_execute
context)
  File /usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py,
line 1394, in _cursor_execute
context)
  File /usr/lib/python2.7/site-packages/sqlalchemy/dialects/firebird/
base.py, line 680, in do_execute
cursor.execute(statement, parameters or [])
ProgrammingError: (ProgrammingError) (-204, 'isc_dsql_prepare: \n
Dynamic SQL Error\n  SQL error code = -204\n  Table unknown\n  NONE\n
At line 2, column 19') 'SELECT DISTINCT assets.yr \nFROM assets, None
ORDER BY assets.yr ASC' ()


the table was defined as

create domain D_CURR char (3) default 'EUR' not null;
create domain D_MONEY decimal(10,2) default 0 not null;

recreate table assets(
id integer not null,
yr smallint not null,
cost d_money not null,
curr d_curr not null,
residual d_money not null,
class integer not null,
realised d_money default 0,
constraint pk_asset primary key(id)
);

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.