# Path: solace/database.py
# def get_engine():
# def refresh_engine():
# def atomic_add(obj, column, delta, expire=False):
# def mapper(model, table, **options):
#     def cursor_execute(self, execute, cursor, statement, parameters,
#                        context, executemany):
#     def after_delete(self, mapper, connection, instance):
#     def after_insert(self, mapper, connection, instance):
#     def after_update(self, mapper, connection, instance):
#     def _record(self, model, operation):
#     def before_commit(self, session):
#     def after_commit(self, session):
#     def after_rollback(self, session):
#     def __init__(self):
#     def __init__(self):
#     def process_bind_param(self, value, dialect):
#     def process_result_value(self, value, dialect):
#     def is_mutable(self):
#     def __init__(self):
#     def process_bind_param(self, value, dialect):
#     def process_result_value(self, value, dialect):
#     def is_mutable(self):
# def init():
# def drop_tables():
# def add_query_debug_headers(request, response):
# def request_track_query(cursor, statement, parameters, time):
# class ConnectionQueryTrackingProxy(ConnectionProxy):
# class SignalTrackingMapperExtension(MapperExtension):
# class SignalEmittingSessionExtension(SessionExtension):
# class SignalTrackingSession(Session):
# class LocaleType(TypeDecorator):
# class BadgeType(TypeDecorator):


from sqlalchemy import Table, Column, Integer, String, Text, DateTime, \
     ForeignKey, Boolean, Float
from solace.database import LocaleType, BadgeType, metadata

user_badges = Table('user_badges', metadata,
    # the internal id
    Column('badge_id', Integer, primary_key=True),
    # who was the badge awarded to?
    Column('user_id', Integer, ForeignKey('users.user_id')),
    # which badge?
    Column('badge', BadgeType(), index=True),
    # when was the badge awarded?
    Column('awarded', DateTime),
    # optional extra information for the badge system
    Column('payload', String(255))
)

user_messages = Table('user_messages', metadata,
    # the message id
    Column('message_id', Integer, primary_key=True),
    # who was the message sent to?
    Column('user_id', Integer, ForeignKey('users.user_id')),
    # the text of the message
    Column('text', String(512)),
    # the type of the message
    Column('type', String(10))
)

topics = Table('topics', metadata,
    # each topic has an internal ID.  This ID is also displayed in the
    # URL next to an automatically slugified version of the title.
    Column('topic_id', Integer, primary_key=True),
    # the language of the topic

# Path: solace/database.py
# def get_engine():
# def refresh_engine():
# def atomic_add(obj, column, delta, expire=False):
# def mapper(model, table, **options):
#     def cursor_execute(self, execute, cursor, statement, parameters,
#                        context, executemany):
#     def after_delete(self, mapper, connection, instance):
#     def after_insert(self, mapper, connection, instance):
#     def after_update(self, mapper, connection, instance):
#     def _record(self, model, operation):
#     def before_commit(self, session):
#     def after_commit(self, session):
#     def after_rollback(self, session):
#     def __init__(self):
#     def __init__(self):
#     def process_bind_param(self, value, dialect):
#     def process_result_value(self, value, dialect):
#     def is_mutable(self):
#     def __init__(self):
#     def process_bind_param(self, value, dialect):
#     def process_result_value(self, value, dialect):
#     def is_mutable(self):
# def init():
# def drop_tables():
# def add_query_debug_headers(request, response):
# def request_track_query(cursor, statement, parameters, time):
# class ConnectionQueryTrackingProxy(ConnectionProxy):
# class SignalTrackingMapperExtension(MapperExtension):
# class SignalEmittingSessionExtension(SessionExtension):
# class SignalTrackingSession(Session):
# class LocaleType(TypeDecorator):
# class BadgeType(TypeDecorator):


# Path: solace/schema.py
from sqlalchemy import Table, Column, Integer, String, Text, DateTime, \
     ForeignKey, Boolean, Float
from solace.database import LocaleType, BadgeType, metadata


user_badges = Table('user_badges', metadata,
    # the internal id
    Column('badge_id', Integer, primary_key=True),
    # who was the badge awarded to?
    Column('user_id', Integer, ForeignKey('users.user_id')),
    # which badge?
    Column('badge', BadgeType(), index=True),
    # when was the badge awarded?
    Column('awarded', DateTime),
    # optional extra information for the badge system
    Column('payload', String(255))
)

user_messages = Table('user_messages', metadata,
    # the message id
    Column('message_id', Integer, primary_key=True),
    # who was the message sent to?
    Column('user_id', Integer, ForeignKey('users.user_id')),
    # the text of the message
    Column('text', String(512)),
    # the type of the message
    Column('type', String(10))
)

topics = Table('topics', metadata,
    # each topic has an internal ID.  This ID is also displayed in the
    # URL next to an automatically slugified version of the title.
    Column('topic_id', Integer, primary_key=True),
    # the language of the topic

    Column('locale', LocaleType, index=True),