# Path: oslo_db/sqlalchemy/update_match.py
# def update_on_match(
#     query,
#     specimen,
#     surrogate_key,
#     values=None,
#     attempts=3,
#     include_only=None,
#     process_query=None,
#     handle_failure=None
# ):
# def manufacture_persistent_object(
#         session, specimen, values=None, primary_key=None):
# def manufacture_entity_criteria(entity, include_only=None, exclude=None):
# def manufacture_criteria(mapped, values):
# def _sql_crit(expression, value):
# def update_returning_pk(query, values, surrogate_key):
# def _assert_single_row(rows_updated):
# def _pk_strategy_refetch(query, mapper, values, surrogate_key):
# def _pk_strategy_returning(query, mapper, values, surrogate_key):
# def _pk_strategy_mysql_last_insert_id(query, mapper, values, surrogate_key):
# def _update_stmt_from_query(mapper, query, values):
# class CantUpdateException(Exception):
# class NoRowsMatched(CantUpdateException):
# class MultiRowsMatched(CantUpdateException):
# 
# Path: oslo_db/tests/base.py
# class BaseTestCase(base.BaseTestCase):
#     def setUp(self):
# 
# Path: oslo_db/tests/sqlalchemy/base.py
# class Context(object):
# class DbTestCase(db_fixtures.OpportunisticDBTestMixin, test_base.BaseTestCase):
# class MySQLOpportunisticTestCase(DbTestCase):
# class PostgreSQLOpportunisticTestCase(DbTestCase):
# class _DbTestCase(
#     db_fixtures.OpportunisticDBTestMixin, test_base.BaseTestCase,
# ):
# class _MySQLOpportunisticTestCase(_DbTestCase):
# class _PostgreSQLOpportunisticTestCase(_DbTestCase):
#     def setUp(self):
#     def setUp(self):
#     FIXTURE = db_fixtures.MySQLOpportunisticFixture
#     FIXTURE = db_fixtures.PostgresqlOpportunisticFixture
#     FIXTURE = db_fixtures.MySQLOpportunisticFixture
#     FIXTURE = db_fixtures.PostgresqlOpportunisticFixture


from sqlalchemy import orm
from sqlalchemy import schema
from sqlalchemy import sql
from sqlalchemy import types as sqltypes
from oslo_db.sqlalchemy import update_match
from oslo_db.tests import base as test_base
from oslo_db.tests.sqlalchemy import base as db_test_base
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.



Base = orm.declarative_base()


class MyModel(Base):
    __tablename__ = 'my_table'

    id = schema.Column(sqltypes.Integer, primary_key=True)
    uuid = schema.Column(sqltypes.String(36), nullable=False, unique=True)
    x = schema.Column(sqltypes.Integer)
    y = schema.Column(sqltypes.String(40))
    z = schema.Column(sqltypes.String(40))



# Path: oslo_db/sqlalchemy/update_match.py
# def update_on_match(
#     query,
#     specimen,
#     surrogate_key,
#     values=None,
#     attempts=3,
#     include_only=None,
#     process_query=None,
#     handle_failure=None
# ):
# def manufacture_persistent_object(
#         session, specimen, values=None, primary_key=None):
# def manufacture_entity_criteria(entity, include_only=None, exclude=None):
# def manufacture_criteria(mapped, values):
# def _sql_crit(expression, value):
# def update_returning_pk(query, values, surrogate_key):
# def _assert_single_row(rows_updated):
# def _pk_strategy_refetch(query, mapper, values, surrogate_key):
# def _pk_strategy_returning(query, mapper, values, surrogate_key):
# def _pk_strategy_mysql_last_insert_id(query, mapper, values, surrogate_key):
# def _update_stmt_from_query(mapper, query, values):
# class CantUpdateException(Exception):
# class NoRowsMatched(CantUpdateException):
# class MultiRowsMatched(CantUpdateException):
# 
# Path: oslo_db/tests/base.py
# class BaseTestCase(base.BaseTestCase):
#     def setUp(self):
# 
# Path: oslo_db/tests/sqlalchemy/base.py
# class Context(object):
# class DbTestCase(db_fixtures.OpportunisticDBTestMixin, test_base.BaseTestCase):
# class MySQLOpportunisticTestCase(DbTestCase):
# class PostgreSQLOpportunisticTestCase(DbTestCase):
# class _DbTestCase(
#     db_fixtures.OpportunisticDBTestMixin, test_base.BaseTestCase,
# ):
# class _MySQLOpportunisticTestCase(_DbTestCase):
# class _PostgreSQLOpportunisticTestCase(_DbTestCase):
#     def setUp(self):
#     def setUp(self):
#     FIXTURE = db_fixtures.MySQLOpportunisticFixture
#     FIXTURE = db_fixtures.PostgresqlOpportunisticFixture
#     FIXTURE = db_fixtures.MySQLOpportunisticFixture
#     FIXTURE = db_fixtures.PostgresqlOpportunisticFixture


# Path: oslo_db/tests/sqlalchemy/test_update_match.py
from sqlalchemy import orm
from sqlalchemy import schema
from sqlalchemy import sql
from sqlalchemy import types as sqltypes
from oslo_db.sqlalchemy import update_match
from oslo_db.tests import base as test_base
from oslo_db.tests.sqlalchemy import base as db_test_base

#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.



Base = orm.declarative_base()


class MyModel(Base):
    __tablename__ = 'my_table'

    id = schema.Column(sqltypes.Integer, primary_key=True)
    uuid = schema.Column(sqltypes.String(36), nullable=False, unique=True)
    x = schema.Column(sqltypes.Integer)
    y = schema.Column(sqltypes.String(40))
    z = schema.Column(sqltypes.String(40))



class ManufactureCriteriaTest(test_base.BaseTestCase):