diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-17 18:35:25 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-17 18:35:25 -0400 |
| commit | a2468c8a31c8308cdb5740f2401e9dedd003836e (patch) | |
| tree | e4cc3eb17c59f678ea2919ecd0880f1df7854b6e /test/aaa_profiling/test_compiler.py | |
| parent | 20fa7fe2b85d356e3da08191f01d7528ded42033 (diff) | |
| download | sqlalchemy-a2468c8a31c8308cdb5740f2401e9dedd003836e.tar.gz | |
- [feature] To complement [ticket:2547], types
can now provide "bind expressions" and
"column expressions" which allow compile-time
injection of SQL expressions into statements
on a per-column or per-bind level. This is
to suit the use case of a type which needs
to augment bind- and result- behavior at the
SQL level, as opposed to in the Python level.
Allows for schemes like transparent encryption/
decryption, usage of Postgis functions, etc.
[ticket:1534]
- update postgis example fully.
- still need to repair the result map propagation
here to be transparent for cases like "labeled column".
Diffstat (limited to 'test/aaa_profiling/test_compiler.py')
| -rw-r--r-- | test/aaa_profiling/test_compiler.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/test/aaa_profiling/test_compiler.py b/test/aaa_profiling/test_compiler.py index 129d0bf06..deff49f0f 100644 --- a/test/aaa_profiling/test_compiler.py +++ b/test/aaa_profiling/test_compiler.py @@ -34,20 +34,30 @@ class CompileTest(fixtures.TestBase, AssertsExecutionResults): cls.dialect = default.DefaultDialect() - @profiling.function_call_count(62) + @profiling.function_call_count() def test_insert(self): t1.insert().compile(dialect=self.dialect) - @profiling.function_call_count(56) + @profiling.function_call_count() def test_update(self): t1.update().compile(dialect=self.dialect) - @profiling.function_call_count(110) def test_update_whereclause(self): - t1.update().where(t1.c.c2==12).compile(dialect=self.dialect) + t1.update().where(t1.c.c2 == 12).compile(dialect=self.dialect) + + @profiling.function_call_count() + def go(): + t1.update().where(t1.c.c2 == 12).compile(dialect=self.dialect) + go() - @profiling.function_call_count(139) def test_select(self): - s = select([t1], t1.c.c2==t2.c.c1) + # give some of the cached type values + # a chance to warm up + s = select([t1], t1.c.c2 == t2.c.c1) s.compile(dialect=self.dialect) + @profiling.function_call_count() + def go(): + s = select([t1], t1.c.c2 == t2.c.c1) + s.compile(dialect=self.dialect) + go()
\ No newline at end of file |
