):
if compiler.dialect.name == 'postgres':
return pg_year(%s) % self.value
else:
return sqlite_year(%s) % self.value
year._compiler_dispatch = _compiler_dispatch
che wrote:
Hi,
i need to add several functions to all dialects that i'll plan to use
in order to be fully database
Hi,
i need to add several functions to all dialects that i'll plan to use
in order to be fully database-independent.
Does anybody have tips how to achieve this?
For example i want to add function year( date) to sqlite and postgres
dialects.
TIA,
Stefan
hi alchemysts,
as of end of march 2009 there will be version of PostgreSQL
(hopefully, finally;) that will support recursive sqls (WITH
RECURSIVE...) and there are also at least 4 other main SQL that
already support it (DB2, MSSQL, Firebird, Oracle (syntax diff)), do
you have plans for adding
Hi,
On 11 , 04:02, Michael Bayer [EMAIL PROTECTED] wrote:
On Nov 10, 2007, at 4:54 PM, Manlio Perillo wrote:
Isn't it possible to just use the order used by the programmer?
If I call
save(A)
save(B)
the order of save() is signficant for instances of one class:
save(A1)
please help
--~--~-~--~~~---~--~~
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
id = connection.execute(Sequence('my_sequence'))
thanks, Michael
--~--~-~--~~~---~--~~
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
Hi,
Are there any database independent way to get the id from some
sequence - for databases that supports it? For postgres this can be
done by issueing select nextval('name_of_the_sequence') statement,
but for other databases like oracle, firebird it is maybe different.
It seems that there is no
Hi,
this issue (#759) seems fixed with the SA0.4b5. Thanks, Michael.
One additional question concerning last_inserted_ids() - is it
supposed to work below:
...
isql = Insert( table_Manager, values= {'name':bindparam('name'),
'duties':bindparam('duties
r2 = con.execute( isql, [
Thanks Michael,
it is not urgent to me. if i found time i'll look down what is causing
this and eventually try to patch.
regards,
stefan
On 25 Авг, 03:09, Michael Bayer [EMAIL PROTECTED] wrote:
On Aug 23, 2007, at 11:18 AM, che wrote:
i cant reply to this issue for another week since im
Hi,
i tried suggested in other thread way of inserting many records into
database table and it raised exception against postgres (psycopg2)
using the latest trunk (r3412) of SA. Then i checked that in version
0.3.10 same(analogical) code works. Please tell me if there is
something wrong with my
Hi,
On 23 Авг, 17:47, Michael Bayer [EMAIL PROTECTED] wrote:
dont compile() the insert statement yourself here; since you are only
executing it once, theres nothing to be gained by manually compiling
first.
this was the minimal code demonstrating the issue.
i planned to do this many times for
Hi,
On 31 Юли, 02:33, Paul Johnston [EMAIL PROTECTED] wrote:
Yes, please do. I think you'll find some tweak to MssqlCompiler can
achieve this.
BTW, AND/OR are not broken generally; I think it's just BIT columns they
have a problem with.
Paul
I dont know how to restrict my changes only
On 2 Авг, 17:00, Michael Bayer [EMAIL PROTECTED] wrote:
On Aug 2, 2007, at 5:07 AM, che wrote:
you might want to try a. working with the 0.4 trunk, which has a
simpler compilation scheme and b. just overriding visit_select() to
pass a flag down into sub-visit_XXX calls.
also what
On 31 Юли, 02:33, Paul Johnston [EMAIL PROTECTED] wrote:
Hi,
anyway this seems like bug to me as this will create database-
dependence (also AND and OR not working too in MSSQL). i'll try to
prepare some general patch to this and send back here (if someone
didnot outrun me).
Yes, please
Hi,
On 27 Юли, 23:27, Paul Johnston [EMAIL PROTECTED] wrote:
Hi,
type. Do you have some idea how to preserve entire boolean semantics
in mssql?
I've not tried this but perhaps comparing to 1 does the trick, e.g.
instead of a and not b do (a = 1) and not (b = 1)
yes, thanks. this works.
Hi,
unfortunately my time-limited trial license of the easysoft driver
already expired so i cannot check it further.
thanks anyway for your wilingness to help.
regards,
stefan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
hmm it gives with use_scope_identity=False and r2746:
File /home/stefanb/src/hor/sqlalchemy/engine/strategies.py, line
106, in create
raise TypeError(Invalid argument(s) %s sent to create_engine(),
using configuration %s/%s/%s. Please check that the keyword arguments
are appropriate for
shame on me I omit your ...addng the keyword parameter..., i.e.
db_mssql = create_engine( 'mssql://sa:[EMAIL PROTECTED]
use_scope_identity=1', module= pyodbc)
unfortunately with scope identity it crashes earlier - mssql.py
returns None for id and rollbacks.
best regards
stefan
forgot to mention that SA is at revision r2733.
--~--~-~--~~~---~--~~
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,
Thanks Evan,
Hope that soon I'll use your tool.
Stefan
--~--~-~--~~~---~--~~
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
Hi,
I tried to eager load some data from class that have reference to
polymorhic class. The object model is: class Base inherited by both
Manager and Address, Managers has reference to Address - when I stop
here SA can eager loading the addresses of managers. The problem arise
when I add another
Thanks Michael,
Michael Bayer написа:
On Mar 19, 2007, at 8:29 AM, che wrote:
Maybe the problem is that somehow
polymorhic and eager cannot be combined?
please advice
thats correct, in many cases eager loading will degrade to lazy
loading, particularly when it detects a self
Hi,
it would be good if SA has similar feature to return scalar, but from
the point of view of objects - SA internally knows inheritance and
so on ... so one doesnt have to bother of exact tables, but only the
object. This can be usefull for reporting on top of SA - see for
example if you have
seems the following will do the job:
group_columns = [table.c.col1, table.c.col2]
select_columns = group_columns + [sqlalchemy.func.sum(table.c.col3),
sqlalchemy.func.sum(table.c.col4)]
statement = sqlalchemy.select( select_columns, (table.c.col1 ==
test), group_by=group_columns)
res =
thanks again, Michael.
Stefan
--~--~-~--~~~---~--~~
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
Hi,
I have a table with column that must use sequence generated number
(for example in Postgres), like this obj_id:
table_Manager = Table( 'Manager', meta,
Column( 'obj_id', Integer, Sequence('obj_id_seq'), ),
Column( 'duties', type= String, ),
Column( 'name', type=
Hi,
Michael Bayer написа:
if you dont want to use the trunk for now, you can probably define
the column as:
Column('obj_id', integer, default=func.obj_id_seq.nextval())
this answers another question of mine :) that i planned to ask
...but it generates (on Postgres) this:
SELECT
Hi,
Michael Bayer написа:
SA can form joins between tables automatically if the tables express
the proper foreign key relationship between each other, and if there is
no ambiguity in that relationship; i.e. table A and table B have only
one ForeignKeyConstraint (or single ForeignKey)
Hi,
I am trying to translate to sqlalchemy my queries having on object
level clauses like the a.b.c.d == some_value where a is instance of
class A, b - instance of class B and...
How such queries can be expressed in sqlalchemy code (supposing that
every class is mapped to its own table)? Are
29 matches
Mail list logo