rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
p = pool.QueuePool(creator=mock_dbapi.connect, pool_size=3, max_overflow=-1, use_threadlocal=True) | p = self._queuepool_fixture(pool_size=3, max_overflow=-1, use_threadlocal=True) | def test_threadfairy(self): p = pool.QueuePool(creator=mock_dbapi.connect, pool_size=3, max_overflow=-1, use_threadlocal=True) c1 = p.connect() c1.close() c2 = p.connect() assert c2.connection is not None | 7513b46730d1b57a6b8addde8dfb4f83ee1e6cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/7513b46730d1b57a6b8addde8dfb4f83ee1e6cb4/test_pool.py |
p = pool.SingletonThreadPool(creator=mock_dbapi.connect, | dbapi = MockDBAPI() p = pool.SingletonThreadPool(creator=dbapi.connect, | def test_cleanup(self): """test that the pool's connections are OK after cleanup() has been called.""" | 7513b46730d1b57a6b8addde8dfb4f83ee1e6cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/7513b46730d1b57a6b8addde8dfb4f83ee1e6cb4/test_pool.py |
__only_on__ = 'oracle+cx-oracle' | __only_on__ = 'oracle+cx_oracle' | def test_raw_lobs(self): engine = testing_engine(options=dict(auto_convert_lobs=False)) metadata = MetaData() t = Table("z_test", metadata, Column('id', Integer, primary_key=True), Column('data', Text), Column('bindata', LargeBinary)) t.create(engine) try: engine.execute(t.insert(), id=1, data='this is text', bindata='... | 3d72efba2b1a39a52a2736dbc2ad7492b2455b27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/3d72efba2b1a39a52a2736dbc2ad7492b2455b27/test_oracle.py |
return _BindParamClause(key.name, value, type_=key.type, unique=unique, required=required) | return _BindParamClause(key.name, value, type_=key.type, unique=unique, required=required) | def bindparam(key, value=None, type_=None, unique=False, required=False): """Create a bind parameter clause with the given key. value a default value for this bind parameter. a bindparam with a value is called a ``value-based bindparam``. type\_ a sqlalchemy.types.TypeEngine object indicating the type of this bind p... | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
return _BindParamClause(key, value, type_=type_, unique=unique, required=required) | return _BindParamClause(key, value, type_=type_, unique=unique, required=required) | def bindparam(key, value=None, type_=None, unique=False, required=False): """Create a bind parameter clause with the given key. value a default value for this bind parameter. a bindparam with a value is called a ``value-based bindparam``. type\_ a sqlalchemy.types.TypeEngine object indicating the type of this bind p... | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
raise exc.ArgumentError("Ambiguous literal: %r. Use the 'text()' function " "to indicate a SQL expression literal, or 'literal()' to indicate a bound value." % element) | raise exc.ArgumentError("Ambiguous literal: %r. Use the 'text()' " "function to indicate a SQL expression " "literal, or 'literal()' to indicate a " "bound value." % element) | def _no_literals(element): if hasattr(element, '__clause_element__'): return element.__clause_element__() elif not isinstance(element, Visitable): raise exc.ArgumentError("Ambiguous literal: %r. Use the 'text()' function " "to indicate a SQL expression literal, or 'literal()' to indicate a bound value." % element) els... | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
def __hash__(self): """Return a distinct hash code. ClauseElements may have special equality comparisons which makes us rely on them having unique hash codes for use in hash-based collections. Stock __hash__ doesn't guarantee unique values on platforms with moving GCs. """ return id(self) | def __hash__(self): """Return a distinct hash code. ClauseElements may have special equality comparisons which makes us rely on them having unique hash codes for use in hash-based collections. Stock __hash__ doesn't guarantee unique values on platforms with moving GCs. """ return id(self) | def __hash__(self): """Return a distinct hash code. | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
"""Return True if the given :class:`ColumnElement` has a common ancestor to this :class:`ColumnElement`.""" | """Return True if the given :class:`ColumnElement` has a common ancestor to this :class:`ColumnElement`.""" | def shares_lineage(self, othercolumn): """Return True if the given :class:`ColumnElement` has a common ancestor to this :class:`ColumnElement`.""" | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
"""add the given column to this collection, removing unaliased versions of this column as well as existing columns with the same key. | """add the given column to this collection, removing unaliased versions of this column as well as existing columns with the same key. | def replace(self, column): """add the given column to this collection, removing unaliased versions of this column as well as existing columns with the same key. | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
def __setitem__(self, key, value): if key in self: # this warning is primarily to catch select() statements which have conflicting # column names in their exported columns collection existing = self[key] if not existing.shares_lineage(value): util.warn(("Column %r on table %r being replaced by another " "column with th... | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py | ||
"""Return the collection of Column objects which comprise the primary key of this FromClause.""" | """Return the collection of Column objects which comprise the primary key of this FromClause.""" | def _primary_key(self): """Return the collection of Column objects which comprise the primary key of this FromClause.""" | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
"""Return the collection of ForeignKey objects which this FromClause references.""" | """Return the collection of ForeignKey objects which this FromClause references.""" | def _foreign_keys(self): """Return the collection of ForeignKey objects which this FromClause references.""" | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
self.key = _generated_label("%%(%d %s)s" % (id(self), self._orig_key or 'param')) | self.key = _generated_label("%%(%d %s)s" % (id(self), self._orig_key or 'param')) | def _convert_to_unique(self): if not self.unique: self.unique = True self.key = _generated_label("%%(%d %s)s" % (id(self), self._orig_key or 'param')) | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
_BindParamClause(None, o, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) | _BindParamClause(None, o, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) | def _bind_param(self, operator, obj): return _Tuple(*[ _BindParamClause(None, o, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) for o in obj ]).self_group() | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
return _BindParamClause(None, obj, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) | return _BindParamClause(None, obj, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) | def _bind_param(self, operator, obj): return _BindParamClause(None, obj, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
return _BindParamClause(self.name, obj, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) | return _BindParamClause(self.name, obj, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) | def _bind_param(self, operator, obj): return _BindParamClause(self.name, obj, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
"""Compare this :class:`_BinaryExpression` against the given :class:`_BinaryExpression`.""" | """Compare this :class:`_BinaryExpression` against the given :class:`_BinaryExpression`.""" | def compare(self, other, **kw): """Compare this :class:`_BinaryExpression` against the given :class:`_BinaryExpression`.""" | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
return _BindParamClause(self.name, obj, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) | return _BindParamClause(self.name, obj, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) | def _bind_param(self, operator, obj): return _BindParamClause(self.name, obj, _compared_to_operator=operator, _compared_to_type=self.type, unique=True) | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
element can be any column expression. :class:`~sqlalchemy.schema.Table` objects will be expanded into their individual columns. | element can be any column expression. :class:`~sqlalchemy.schema.Table` objects will be expanded into their individual columns. | def returning(self, *cols): """Add a RETURNING or equivalent clause to this statement. The given list of columns represent columns within the table that is the target of the INSERT, UPDATE, or DELETE. Each element can be any column expression. :class:`~sqlalchemy.schema.Table` objects will be expanded into their ind... | 0b93f88d2c199737f8d1202bb95240fed122b531 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b93f88d2c199737f8d1202bb95240fed122b531/expression.py |
prop = mapper.get_property(key, raiseerr=False) if prop is None: | if not mapper.has_property(key): | def __getattr__(self, key): mapper = class_mapper(self.cls, compile=False) if mapper: prop = mapper.get_property(key, raiseerr=False) if prop is None: raise exceptions.InvalidRequestError( "Class %r does not have a mapped column named %r" % (self.cls, key)) elif not isinstance(prop, ColumnProperty): raise exceptions.I... | 0d0ed62f73d2465e06a26f3c82ef5e271c8fc460 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0d0ed62f73d2465e06a26f3c82ef5e271c8fc460/declarative.py |
elif not isinstance(prop, ColumnProperty): | prop = mapper.get_property(key) if not isinstance(prop, ColumnProperty): | def __getattr__(self, key): mapper = class_mapper(self.cls, compile=False) if mapper: prop = mapper.get_property(key, raiseerr=False) if prop is None: raise exceptions.InvalidRequestError( "Class %r does not have a mapped column named %r" % (self.cls, key)) elif not isinstance(prop, ColumnProperty): raise exceptions.I... | 0d0ed62f73d2465e06a26f3c82ef5e271c8fc460 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0d0ed62f73d2465e06a26f3c82ef5e271c8fc460/declarative.py |
:mod:~sqlalchemy.engine_TwoPhaseTransaction. During a ``commit()``, after | :mod:`~sqlalchemy.engine_TwoPhaseTransaction`. During a ``commit()``, after | def sessionmaker(bind=None, class_=None, autoflush=True, autocommit=False, expire_on_commit=True, **kwargs): """Generate a custom-configured :class:`~sqlalchemy.orm.session.Session` class. The returned object is a subclass of ``Session``, which, when instantiated with no arguments, uses the keyword arguments configure... | 31d168d2c3f322d013f7944701072ce4d5d420af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/31d168d2c3f322d013f7944701072ce4d5d420af/session.py |
def adapt(self, impltype, **kw): return impltype(as_uuid=self.as_uuid, **kw) | def process(value): if value is not None: value = _python_UUID(value) return value | 0052abd9e4aa67fed00a181e57cfcb54df1ebc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0052abd9e4aa67fed00a181e57cfcb54df1ebc1d/base.py | |
def dialect_impl(self, dialect, **kwargs): impl = super(ARRAY, self).dialect_impl(dialect, **kwargs) if impl is self: impl = self.__class__.__new__(self.__class__) impl.__dict__.update(self.__dict__) impl.item_type = self.item_type.dialect_impl(dialect) return impl | def dialect_impl(self, dialect, **kwargs): impl = super(ARRAY, self).dialect_impl(dialect, **kwargs) if impl is self: impl = self.__class__.__new__(self.__class__) impl.__dict__.update(self.__dict__) impl.item_type = self.item_type.dialect_impl(dialect) return impl | 0052abd9e4aa67fed00a181e57cfcb54df1ebc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0052abd9e4aa67fed00a181e57cfcb54df1ebc1d/base.py | |
item_proc = self.item_type.bind_processor(dialect) | item_proc = self.item_type.dialect_impl(dialect).bind_processor(dialect) | def bind_processor(self, dialect): item_proc = self.item_type.bind_processor(dialect) if item_proc: def convert_item(item): if isinstance(item, (list, tuple)): return [convert_item(child) for child in item] else: return item_proc(item) else: def convert_item(item): if isinstance(item, (list, tuple)): return [convert_it... | 0052abd9e4aa67fed00a181e57cfcb54df1ebc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0052abd9e4aa67fed00a181e57cfcb54df1ebc1d/base.py |
item_proc = self.item_type.result_processor(dialect, coltype) | item_proc = self.item_type.dialect_impl(dialect).result_processor(dialect, coltype) | def result_processor(self, dialect, coltype): item_proc = self.item_type.result_processor(dialect, coltype) if item_proc: def convert_item(item): if isinstance(item, list): r = [convert_item(child) for child in item] if self.as_tuple: r = tuple(r) return r else: return item_proc(item) else: def convert_item(item): if i... | 0052abd9e4aa67fed00a181e57cfcb54df1ebc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0052abd9e4aa67fed00a181e57cfcb54df1ebc1d/base.py |
Column('id', Integer, primary_key=True), | Column('id', Integer, primary_key=True, test_needs_autoincrement=True), | def test_many_updates(self): metadata = MetaData(testing.db) wide_table = Table('t', metadata, Column('id', Integer, primary_key=True), *[Column('col%d' % i, Integer) for i in range(10)] ) class Wide(object): pass mapper(Wide, wide_table, _compiled_cache_size=10) metadata.create_all() session = create_session() w1 ... | 464f295854d43180ad60e414e5110ec6c7b7150e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/464f295854d43180ad60e414e5110ec6c7b7150e/test_memusage.py |
@testing.fails_on_everything_except('firebird', 'maxdb', 'sqlite', '+pyodbc', '+mxodbc', '+zxjdbc', 'mysql+oursql') | @testing.fails_on_everything_except('firebird', 'maxdb', 'sqlite', '+pyodbc', '+mxodbc', '+zxjdbc', 'mysql+oursql') | def teardown_class(cls): metadata.drop_all() | f3fb6fe1d8088f0566b0bf7c2596b669c8979cbf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/f3fb6fe1d8088f0566b0bf7c2596b669c8979cbf/test_execute.py |
@testing.fails_on_everything_except('postgresql+psycopg2', 'postgresql+pypostgresql', 'mysql+mysqlconnector') | @testing.fails_on_everything_except('postgresql+psycopg2', 'postgresql+pypostgresql', 'mysql+mysqlconnector') | def test_raw_sprintf(self): for conn in (testing.db, testing.db.connect()): conn.execute("insert into users (user_id, user_name) values (%s, %s)", [1,"jack"]) conn.execute("insert into users (user_id, user_name) values (%s, %s)", [2,"ed"], [3,"horse"]) conn.execute("insert into users (user_id, user_name) values (%s, %s... | f3fb6fe1d8088f0566b0bf7c2596b669c8979cbf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/f3fb6fe1d8088f0566b0bf7c2596b669c8979cbf/test_execute.py |
Column('user_id', INT, primary_key = True), | Column('user_id', INT, primary_key=True, test_needs_autoincrement=True), | def setup_class(cls): global users, metadata metadata = MetaData(testing.db) users = Table('users', metadata, Column('user_id', INT, primary_key = True), Column('user_name', VARCHAR(20)), ) metadata.create_all() | f3fb6fe1d8088f0566b0bf7c2596b669c8979cbf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/f3fb6fe1d8088f0566b0bf7c2596b669c8979cbf/test_execute.py |
@profiling.function_call_count(95, variance=0.001) | @profiling.function_call_count(95, variance=0.001, versions={'2.4':67}) | def test_merge_no_load(self): sess = sessionmaker()() sess2 = sessionmaker()() p1 = sess.query(Parent).get(1) p1.children # down from 185 on this # this is a small slice of a usually bigger # operation so using a small variance @profiling.function_call_count(95, variance=0.001) def go(): return sess2.merge(p1, load=F... | e0215c12d70cbef200db98e4179797625aac1f49 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/e0215c12d70cbef200db98e4179797625aac1f49/test_orm.py |
def create_connect_args(self, url): dialect_opts = dict(url.query) for opt in ('use_ansi', 'auto_setinputsizes', 'auto_convert_lobs', 'threaded', 'allow_twophase'): if opt in dialect_opts: util.coerce_kw_type(dialect_opts, opt, bool) setattr(self, opt, dialect_opts[opt]) | bc3accfbba0bb25e2ca82e4189d99cac3235ca70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/bc3accfbba0bb25e2ca82e4189d99cac3235ca70/cx_oracle.py | ||
The preferred method to construct an :class:`Inspector` is via the | The preferred method to construct an :class:`.Inspector` is via the | def cache(fn, self, con, *args, **kw): info_cache = kw.get('info_cache', None) if info_cache is None: return fn(self, con, *args, **kw) key = ( fn.__name__, tuple(a for a in args if isinstance(a, basestring)), tuple((k, v) for k, v in kw.iteritems() if isinstance(v, (basestring, int, float))) ) ret = info_cache.get(key... | 914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d/reflection.py |
to return an :class:`Inspector` subclass that provides additional | to return an :class:`.Inspector` subclass that provides additional | def cache(fn, self, con, *args, **kw): info_cache = kw.get('info_cache', None) if info_cache is None: return fn(self, con, *args, **kw) key = ( fn.__name__, tuple(a for a in args if isinstance(a, basestring)), tuple((k, v) for k, v in kw.iteritems() if isinstance(v, (basestring, int, float))) ) ret = info_cache.get(key... | 914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d/reflection.py |
"""Initialize a new :class:`Inspector`. | """Initialize a new :class:`.Inspector`. | def __init__(self, bind): """Initialize a new :class:`Inspector`. | 914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d/reflection.py |
For a dialect-specific instance of :class:`Inspector`, see | For a dialect-specific instance of :class:`.Inspector`, see | def __init__(self, bind): """Initialize a new :class:`Inspector`. | 914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d/reflection.py |
This method differs from direct a direct constructor call of :class:`Inspector` | This method differs from direct a direct constructor call of :class:`.Inspector` | def from_engine(cls, bind): """Construct a new dialect-specific Inspector object from the given engine or connection. | 914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d/reflection.py |
a dialect-specific :class:`Inspector` instance, which may provide additional | a dialect-specific :class:`.Inspector` instance, which may provide additional | def from_engine(cls, bind): """Construct a new dialect-specific Inspector object from the given engine or connection. | 914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d/reflection.py |
See the example at :class:`Inspector`. | See the example at :class:`.Inspector`. | def from_engine(cls, bind): """Construct a new dialect-specific Inspector object from the given engine or connection. | 914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d/reflection.py |
cursor.execute(select([1], bind=testing.db)) | cursor.execute(str(select([1], bind=testing.db))) | def test_cursor_iterable(self): conn = testing.db.raw_connection() cursor = conn.cursor() cursor.execute(select([1], bind=testing.db)) expected = [(1,)] for row in cursor: eq_(row, expected.pop(0)) | 649d1f11c3d62ca0fe5024a036afe09a594c40ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/649d1f11c3d62ca0fe5024a036afe09a594c40ba/test_pool.py |
super(MSSQLDialect_pymssql, self).__init__(**params) | super(MSDialect_pymssql, self).__init__(**params) | def __init__(self, **params): super(MSSQLDialect_pymssql, self).__init__(**params) self.use_scope_identity = True | 342265ec3eff16fc2723f8e904a9cc7e1b12f943 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/342265ec3eff16fc2723f8e904a9cc7e1b12f943/pymssql.py |
arrtable.insert().execute(intarr=[1,2,3], strarr=['abc', 'def']) | arrtable.insert().execute(intarr=[1,2,3], strarr=[u'abc', u'def']) | def test_insert_array(self): arrtable.insert().execute(intarr=[1,2,3], strarr=['abc', 'def']) results = arrtable.select().execute().fetchall() eq_(len(results), 1) eq_(results[0]['intarr'], [1,2,3]) eq_(results[0]['strarr'], ['abc','def']) | 11f996da20cf40692a21f6e836655cc36d1857d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/11f996da20cf40692a21f6e836655cc36d1857d7/test_postgresql.py |
arrtable.insert().execute(intarr=[1,2,3], strarr=['abc', 'def']) arrtable.insert().execute(intarr=[4,5,6], strarr='ABC') | arrtable.insert().execute(intarr=[1,2,3], strarr=[u'abc', u'def']) arrtable.insert().execute(intarr=[4,5,6], strarr=u'ABC') | def test_array_where(self): arrtable.insert().execute(intarr=[1,2,3], strarr=['abc', 'def']) arrtable.insert().execute(intarr=[4,5,6], strarr='ABC') results = arrtable.select().where(arrtable.c.intarr == [1,2,3]).execute().fetchall() eq_(len(results), 1) eq_(results[0]['intarr'], [1,2,3]) | 11f996da20cf40692a21f6e836655cc36d1857d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/11f996da20cf40692a21f6e836655cc36d1857d7/test_postgresql.py |
arrtable.insert().execute(intarr=[1,2,3], strarr=['abc', 'def']) | arrtable.insert().execute(intarr=[1,2,3], strarr=[u'abc', u'def']) | def test_array_concat(self): arrtable.insert().execute(intarr=[1,2,3], strarr=['abc', 'def']) results = select([arrtable.c.intarr + [4,5,6]]).execute().fetchall() eq_(len(results), 1) eq_(results[0][0], [1,2,3,4,5,6]) | 11f996da20cf40692a21f6e836655cc36d1857d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/11f996da20cf40692a21f6e836655cc36d1857d7/test_postgresql.py |
insert2_params.append(ReturningParam(12)) | insert2_params += (ReturningParam(12),) | def assert_stmts(expected, received): for stmt, params, posn in expected: if not received: assert False while received: teststmt, testparams, testmultiparams = received.pop(0) teststmt = re.compile(r'[\n\t ]+', re.M).sub(' ', teststmt).strip() if teststmt.startswith(stmt) and (testparams==params or testparams==posn): b... | 0b78ef9e7a0292f78ef06ff36202e78e4a3f5981 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/0b78ef9e7a0292f78ef06ff36202e78e4a3f5981/test_execute.py |
return bind.dialect.inspector(engine) | return bind.dialect.inspector(bind) | def from_engine(cls, bind): """Construct a new dialect-specific Inspector object from the given engine or connection. | e0aa61018545700119d294197ac4581430cb2335 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/e0aa61018545700119d294197ac4581430cb2335/reflection.py |
visitables.append((prop.cascade_iterator(type_, parent_state, visited_instances, halt_on), 'mapper', None)) | visitables.append((prop.cascade_iterator(type_, parent_state, visited_instances, halt_on), 'mapper', None)) | def cascade_iterator(self, type_, state, halt_on=None): """Iterate each element and its mapper in an object graph, for all relationships that meet the given cascade rule. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
visitables.append((instance_mapper._props.itervalues(), 'property', corresponding_state)) | visitables.append((instance_mapper._props.itervalues(), 'property', corresponding_state)) | def cascade_iterator(self, type_, state, halt_on=None): """Iterate each element and its mapper in an object graph, for all relationships that meet the given cascade rule. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
self._save_obj([state], uowtransaction, postupdate=postupdate, post_update_cols=post_update_cols, single=True) | self._save_obj([state], uowtransaction, postupdate=postupdate, post_update_cols=post_update_cols, single=True) | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py | ||
tups = [] | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py | |
connection_callable = uowtransaction.mapper_flush_opts['connection_callable'] for state in _sort_states(states): m = _state_mapper(state) tups.append( ( state, m, connection_callable(self, state.obj()), _state_has_identity(state), state.key or m._identity_key_from_state(state) ) ) | connection_callable = \ uowtransaction.mapper_flush_opts['connection_callable'] | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
for state in _sort_states(states): m = _state_mapper(state) tups.append( ( state, m, connection, _state_has_identity(state), state.key or m._identity_key_from_state(state) ) ) if not postupdate: for state, mapper, connection, has_identity, instance_key in tups: | connection_callable = None tups = [] for state in _sort_states(states): conn = connection_callable and \ connection_callable(self, state.obj()) or \ connection has_identity = _state_has_identity(state) mapper = _state_mapper(state) instance_key = state.key or mapper._identity_key_from_state(state) row_switch = None ... | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
mapper.extension.before_insert(mapper, connection, state.obj()) | mapper.extension.before_insert(mapper, conn, state.obj()) | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
mapper.extension.before_update(mapper, connection, state.obj()) row_switches = {} if not postupdate: for state, mapper, connection, has_identity, instance_key in tups: | mapper.extension.before_update(mapper, conn, state.obj()) | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py | ||
def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py | ||
"detected row switch for identity %s. will update %s, remove %s from " "transaction", instance_key, state_str(state), state_str(existing)) | "detected row switch for identity %s. " "will update %s, remove %s from " "transaction", instance_key, state_str(state), state_str(existing)) | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
row_switches[state] = existing | row_switch = existing tups.append( (state, mapper, conn, has_identity, instance_key, row_switch) ) | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
for table in table_to_mapper.iterkeys(): | for table in table_to_mapper: | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
for state, mapper, connection, has_identity, instance_key in tups: | for state, mapper, connection, has_identity, \ instance_key, row_switch in tups: | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
isinsert = not has_identity and not postupdate and state not in row_switches | isinsert = not has_identity and \ not postupdate and \ not row_switch | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
insert.append((state, params, mapper, connection, value_params)) | insert.append((state, params, mapper, connection, value_params)) | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
params[col._label] = mapper._get_state_attr_by_column(row_switches.get(state, state), col) params[col.key] = mapper.version_id_generator(params[col._label]) | params[col._label] = \ mapper._get_state_attr_by_column( row_switch or state, col) params[col.key] = \ mapper.version_id_generator(params[col._label]) | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
history = attributes.get_state_history(state, prop.key, passive=True) | history = attributes.get_state_history( state, prop.key, passive=True) | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
mapper.polymorphic_on.shares_lineage(col) and col not in pks: | mapper.polymorphic_on.shares_lineage(col) and \ col not in pks: | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
if post_update_cols is not None and col not in post_update_cols: | if post_update_cols is not None and \ col not in post_update_cols: | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
params[col._label] = mapper._get_state_attr_by_column(state, col) | params[col._label] = \ mapper._get_state_attr_by_column(state, col) | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
update.append((state, params, mapper, connection, value_params)) | update.append((state, params, mapper, connection, value_params)) | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
clause.clauses.append(col == sql.bindparam(col._label, type_=col.type)) if mapper.version_id_col is not None and \ table.c.contains_column(mapper.version_id_col): | clause.clauses.append( col == sql.bindparam(col._label, type_=col.type) ) needs_version_id = mapper.version_id_col is not None and \ table.c.contains_column(mapper.version_id_col) if needs_version_id: | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py | ||
mapper._postfetch(uowtransaction, connection, table, | mapper._postfetch(uowtransaction, table, | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
"Updated rowcount %d does not match number of objects updated %d" % | "Updated rowcount %d does not match number " "of objects updated %d" % | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
elif mapper.version_id_col is not None: | elif needs_version_id: | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
"- versioning cannot be verified." % c.dialect.dialect_description, stacklevel=12) | "- versioning cannot be verified." % c.dialect.dialect_description, stacklevel=12) | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
mapper._postfetch(uowtransaction, connection, table, | mapper._postfetch(uowtransaction, table, | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py | ||
for state, mapper, connection, has_identity, instance_key in tups: | for state, mapper, connection, has_identity, \ instance_key, row_switch in tups: | def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
def _save_obj(self, states, uowtransaction, postupdate=False, post_update_cols=None, single=False): """Issue ``INSERT`` and/or ``UPDATE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py | ||
def _postfetch(self, uowtransaction, connection, table, | def _postfetch(self, uowtransaction, table, | def _postfetch(self, uowtransaction, connection, table, state, resultproxy, params, value_params): """Expire attributes in need of newly persisted database state.""" | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
deferred_props = [prop.key for prop in [self._columntoproperty[c] for c in postfetch_cols]] if deferred_props: _expire_state(state, state.dict, deferred_props) | if postfetch_cols: _expire_state(state, state.dict, [self._columntoproperty[c].key for c in postfetch_cols] ) | def _postfetch(self, uowtransaction, connection, table, state, resultproxy, params, value_params): """Expire attributes in need of newly persisted database state.""" | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
cols = set(table.c) for m in self.iterate_to_root(): if m._inherits_equated_pairs and \ cols.intersection([l for l, r in m._inherits_equated_pairs]): sync.populate(state, m, state, m, m._inherits_equated_pairs, uowtransaction, self.passive_updates) | for m, equated_pairs in self._table_to_equated[table]: sync.populate(state, m, state, m, equated_pairs, uowtransaction, self.passive_updates) @util.memoized_property def _table_to_equated(self): """memoized map of tables to collections of columns to be synchronized upwards to the base mapper.""" result = util.default... | def _postfetch(self, uowtransaction, connection, table, state, resultproxy, params, value_params): """Expire attributes in need of newly persisted database state.""" | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
connection_callable = uowtransaction.mapper_flush_opts['connection_callable'] tups = [(state, _state_mapper(state), connection_callable(self, state.obj())) for state in _sort_states(states)] | connection_callable = \ uowtransaction.mapper_flush_opts['connection_callable'] | def _delete_obj(self, states, uowtransaction): """Issue ``DELETE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
tups = [(state, _state_mapper(state), connection) for state in _sort_states(states)] for state, mapper, connection in tups: | connection_callable = None tups = [] for state in _sort_states(states): mapper = _state_mapper(state) conn = connection_callable and \ connection_callable(self, state.obj()) or \ connection | def _delete_obj(self, states, uowtransaction): """Issue ``DELETE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
mapper.extension.before_delete(mapper, connection, state.obj()) | mapper.extension.before_delete(mapper, conn, state.obj()) tups.append((state, _state_mapper(state), _state_has_identity(state), conn)) | def _delete_obj(self, states, uowtransaction): """Issue ``DELETE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
delete = {} for state, mapper, connection in tups: if table not in mapper._pks_by_table: | delete = util.defaultdict(list) for state, mapper, has_identity, connection in tups: if not has_identity or table not in mapper._pks_by_table: | def _delete_obj(self, states, uowtransaction): """Issue ``DELETE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
if not _state_has_identity(state): continue else: delete.setdefault(connection, []).append(params) | delete[connection].append(params) | def _delete_obj(self, states, uowtransaction): """Issue ``DELETE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
if mapper.version_id_col is not None and table.c.contains_column(mapper.version_id_col): params[mapper.version_id_col.key] = mapper._get_state_attr_by_column(state, mapper.version_id_col) | if mapper.version_id_col is not None and \ table.c.contains_column(mapper.version_id_col): params[mapper.version_id_col.key] = \ mapper._get_state_attr_by_column(state, mapper.version_id_col) | def _delete_obj(self, states, uowtransaction): """Issue ``DELETE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
if mapper.version_id_col is not None and table.c.contains_column(mapper.version_id_col): | need_version_id = mapper.version_id_col is not None and \ table.c.contains_column(mapper.version_id_col) if need_version_id: | def _delete_obj(self, states, uowtransaction): """Issue ``DELETE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
sql.bindparam(mapper.version_id_col.key, type_=mapper.version_id_col.type)) | sql.bindparam( mapper.version_id_col.key, type_=mapper.version_id_col.type ) ) | def _delete_obj(self, states, uowtransaction): """Issue ``DELETE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
c = connection.execute(statement, del_objects) if c.supports_sane_multi_rowcount() and c.rowcount != len(del_objects): raise orm_exc.ConcurrentModificationError("Deleted rowcount %d does not match " "number of objects deleted %d" % (c.rowcount, len(del_objects))) for state, mapper, connection in tups: | rows = -1 if need_version_id and \ not connection.dialect.supports_sane_multi_rowcount: if connection.dialect.supports_sane_rowcount: rows = 0 for params in del_objects: c = connection.execute(statement, params) rows += c.rowcount else: util.warn("Dialect %s does not support deleted rowcount " "- versioning cannot ... | def _delete_obj(self, states, uowtransaction): """Issue ``DELETE`` statements for a list of objects. | dfab13e9ae147a7112a23db5abc4e4b7addc00fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfab13e9ae147a7112a23db5abc4e4b7addc00fa/mapper.py |
kwargs = util.frozendict() | def values(self, *args, **kwargs): """specify the VALUES clause for an INSERT statement, or the SET clause for an UPDATE. | dfcc375e17bc97596e767c2f35a92efcf41d0b81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfcc375e17bc97596e767c2f35a92efcf41d0b81/expression.py | |
self.kwargs = self._process_deprecated_kw(kwargs) | if kwargs: self.kwargs = self._process_deprecated_kw(kwargs) | def __init__(self, table, whereclause, values=None, inline=False, bind=None, returning=None, **kwargs): _ValuesBase.__init__(self, table, values) self._bind = bind self._returning = returning if whereclause is not None: self._whereclause = _literal_as_text(whereclause) else: self._whereclause = None self.inline = inlin... | dfcc375e17bc97596e767c2f35a92efcf41d0b81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfcc375e17bc97596e767c2f35a92efcf41d0b81/expression.py |
self.kwargs = self._process_deprecated_kw(kwargs) | if kwargs: self.kwargs = self._process_deprecated_kw(kwargs) | def __init__(self, table, whereclause, bind=None, returning =None, **kwargs): self._bind = bind self.table = table self._returning = returning if whereclause is not None: self._whereclause = _literal_as_text(whereclause) else: self._whereclause = None | dfcc375e17bc97596e767c2f35a92efcf41d0b81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/dfcc375e17bc97596e767c2f35a92efcf41d0b81/expression.py |
if previous is not value and previous not in (None, PASSIVE_NO_RESULT): | if (previous is not value and previous is not None and previous is not PASSIVE_NO_RESULT): | def fire_replace_event(self, state, dict_, value, previous, initiator): if self.trackparent: if previous is not value and previous not in (None, PASSIVE_NO_RESULT): self.sethasparent(instance_state(previous), False) | 5e2b2bbd95106cfc60df532da3f215f14da82961 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/5e2b2bbd95106cfc60df532da3f215f14da82961/attributes.py |
if oldchild not in (None, PASSIVE_NO_RESULT): | if oldchild is not None and oldchild is not PASSIVE_NO_RESULT: | def set(self, state, child, oldchild, initiator): if oldchild is child: return child if oldchild not in (None, PASSIVE_NO_RESULT): # With lazy=None, there's no guarantee that the full collection is # present when updating via a backref. old_state, old_dict = instance_state(oldchild), instance_dict(oldchild) impl = old_... | 5e2b2bbd95106cfc60df532da3f215f14da82961 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/5e2b2bbd95106cfc60df532da3f215f14da82961/attributes.py |
[c not in (None, PASSIVE_NO_RESULT) and instance_state(c) or None for c in self.added], [c not in (None, PASSIVE_NO_RESULT) and instance_state(c) or None for c in self.unchanged], [c not in (None, PASSIVE_NO_RESULT) and instance_state(c) or None for c in self.deleted], ) | [(c is not None and c is not PASSIVE_NO_RESULT) and instance_state(c) or None for c in self.added], [(c is not None and c is not PASSIVE_NO_RESULT) and instance_state(c) or None for c in self.unchanged], [(c is not None and c is not PASSIVE_NO_RESULT) and instance_state(c) or None for c in self.deleted], ) | def as_state(self): return History( [c not in (None, PASSIVE_NO_RESULT) and instance_state(c) or None for c in self.added], [c not in (None, PASSIVE_NO_RESULT) and instance_state(c) or None for c in self.unchanged], [c not in (None, PASSIVE_NO_RESULT) and instance_state(c) or None for c in self.deleted], ) | 5e2b2bbd95106cfc60df532da3f215f14da82961 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/5e2b2bbd95106cfc60df532da3f215f14da82961/attributes.py |
if original not in [None, NEVER_SET, NO_VALUE]: | if (original is not None and original is not NEVER_SET and original is not NO_VALUE): | def from_attribute(cls, attribute, state, current): original = state.committed_state.get(attribute.key, NEVER_SET) | 5e2b2bbd95106cfc60df532da3f215f14da82961 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/5e2b2bbd95106cfc60df532da3f215f14da82961/attributes.py |
lc_alias = schema._get_table_key(table.name, table.schema) | lc_alias = sa_schema._get_table_key(table.name, table.schema) | def _adjust_casing(self, table, charset=None): """Adjust Table name to the server case sensitivity, if needed.""" | 960863906680b4a2fd4c27fff58e8a5939ea35f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/960863906680b4a2fd4c27fff58e8a5939ea35f1/base.py |
def _commit_twophase_impl(self, xid, is_prepared): return proxy.commit_twophase(self, super(ProxyConnection, self)._commit_twophase_impl, xid, is_prepared) | ded4e1d76b634b94a161bc91a3b4eb9d8777332b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/ded4e1d76b634b94a161bc91a3b4eb9d8777332b/base.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.