firebird is a little like a chicken without a head at this point...im applying fixes but have no FB database with which to test on.
what results/stack traces/everything else are you getting with the current SQLAlchemy trunk ? On May 31, 2007, at 3:33 PM, johnbraduk wrote: > > Roger, > Please excuse the interrupt, but have you applied other fixes? I (and > others) can't event get SQLA to connect to > my Firebird v1.5.4 database running on SUSE Linux. > > John > > > On 30 May, 19:47, "Roger Demetrescu" <[EMAIL PROTECTED]> > wrote: >> Michael, the patch did the trick... >> >> I was able to print the statement, execute it, and also do some >> inserts using ORM... >> >> Now the second part of my problem, which is not fixed yet... ;) >> >> here is the script (now using default value/expression): >> >> ================================ >> >> from datetime import datetime >> from sqlalchemy import * >> >> db = create_engine("firebird://user:[EMAIL PROTECTED]//database.fdb") >> >> metadata = BoundMetaData(db) >> >> pessoa_table = Table('pessoa', metadata, >> Column('pes_id', Integer, primary_key=True), >> Column('pes_data', DateTime, default=func.current_timestamp()), >> Column('pes_nome', String(30)), >> Column('pes_sobrenome', String(30)), >> Column('pes_idade', Integer), >> Column('pes_idade', Integer)) >> >> s = pessoa_table.select() >> u = pessoa_table.update() >> i = pessoa_table.insert() >> >> ================================ >> >> Now my shell session : >> >>>>> i.execute(pes_id=111, pes_data=datetime.now()) >> >> <sqlalchemy.engine.base.ResultProxy object at 0x018C0D50> >> >>>>> i.execute(pes_id=222) >> >> Traceback (most recent call last): >> File "<pyshell#11>", line 1, in <module> >> i.execute(pes_id=222) >> File "d:\sqlalchemy\lib\sqlalchemy\sql.py", line 1175, in execute >> return self.compile(engine=self.engine, >> parameters=compile_params).execute(*multiparams, **params) >> File "d:\sqlalchemy\lib\sqlalchemy\sql.py", line 1064, in execute >> return e.execute_compiled(self, *multiparams, **params) >> File "d:\sqlalchemy\lib\sqlalchemy\engine\base.py", line 783, in >> execute_compiled >> return connection.execute_compiled(compiled, *multiparams, >> **params) >> File "d:\sqlalchemy\lib\sqlalchemy\engine\base.py", line 570, in >> execute_compiled >> context.pre_exec() >> File "d:\sqlalchemy\lib\sqlalchemy\engine\default.py", line 200, >> in pre_exec >> self._process_defaults() >> File "d:\sqlalchemy\lib\sqlalchemy\engine\default.py", line 303, in >> _process_defaults >> newid = drunner.get_column_default(c) >> File "d:\sqlalchemy\lib\sqlalchemy\engine\base.py", line 1234, in >> get_column_default >> return column.default.accept_visitor(self) >> File "d:\sqlalchemy\lib\sqlalchemy\schema.py", line 807, in >> accept_visitor >> return visitor.visit_column_default(self) >> File "d:\sqlalchemy\lib\sqlalchemy\engine\base.py", line 1275, in >> visit_column_default >> return self.exec_default_sql(default) >> File "d:\sqlalchemy\lib\sqlalchemy\databases\firebird.py", line >> 367, >> in exec_default_sql >> c = sql.select([default.arg], >> from_obj=["rdb$database"]).compile(engine=self.engine) >> AttributeError: 'FBDefaultRunner' object has no attribute 'engine' >> >> Now I'm going to explicitly insert a row with pes_data = NULL >> (should'nt that work ??): >> >>>>> i.execute(pes_id=333, pes_data=None) >> >> Traceback (most recent call last): >> File "<pyshell#12>", line 1, in <module> >> i.execute(pes_id=333, pes_data=None) >> File "d:\sqlalchemy\lib\sqlalchemy\sql.py", line 1175, in execute >> return self.compile(engine=self.engine, >> parameters=compile_params).execute(*multiparams, **params) >> File "d:\sqlalchemy\lib\sqlalchemy\sql.py", line 1064, in execute >> return e.execute_compiled(self, *multiparams, **params) >> File "d:\sqlalchemy\lib\sqlalchemy\engine\base.py", line 783, in >> execute_compiled >> return connection.execute_compiled(compiled, *multiparams, >> **params) >> File "d:\sqlalchemy\lib\sqlalchemy\engine\base.py", line 570, in >> execute_compiled >> context.pre_exec() >> File "d:\sqlalchemy\lib\sqlalchemy\engine\default.py", line 200, >> in pre_exec >> self._process_defaults() >> File "d:\sqlalchemy\lib\sqlalchemy\engine\default.py", line 303, in >> _process_defaults >> newid = drunner.get_column_default(c) >> File "d:\sqlalchemy\lib\sqlalchemy\engine\base.py", line 1234, in >> get_column_default >> return column.default.accept_visitor(self) >> File "d:\sqlalchemy\lib\sqlalchemy\schema.py", line 807, in >> accept_visitor >> return visitor.visit_column_default(self) >> File "d:\sqlalchemy\lib\sqlalchemy\engine\base.py", line 1275, in >> visit_column_default >> return self.exec_default_sql(default) >> File "d:\sqlalchemy\lib\sqlalchemy\databases\firebird.py", line >> 367, >> in exec_default_sql >> c = sql.select([default.arg], >> from_obj=["rdb$database"]).compile(engine=self.engine) >> AttributeError: 'FBDefaultRunner' object has no attribute 'engine' >> >> Thanks Michael >> >> PS: I am in the process of upgrading a dedicated host running >> Firebird >> 1.5.... after it is finished, maybe we could talk about how you can >> use it to test firebird engine... (if you are interested, of >> course)... >> >> On 5/30/07, Michael Bayer <[EMAIL PROTECTED]> wrote: >> >>> hey roger - >> >>> the fix for that issue is trivial, however the code which it >>> fixes is >>> doing something that should be done differently (that is, ensuring >>> that all pk columns are present in an INSERT statement). Since I >>> dont have FB here, can you try out the attached patch and see if it >>> works for you, not just for the "print i" part (that part works) but >>> for running some actual INSERT statements (and maybe the ORM) a >>> little bit as well ? >> >>> thanks >> >>> - mike > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---