# Path: django_sharding_library/constants.py
# class Backends(object):
#     MYSQL = ('django.db.backends.mysql', 'django.contrib.gis.db.backends.mysql')
#     POSTGRES = ('django.db.backends.postgresql_psycopg2', 'django.db.backends.postgresql', 'django.contrib.gis.db.backends.postgis')
#     SQLITE = ('django.db.backends.sqlite3', 'django.contrib.gis.db.backends.spacialite')
# 
# Path: django_sharding_library/models.py
# class TableStrategyModel(models.Model):
#     """
#     A model for use with the TableStrategy in order to generate ids using an
#     autoincrimenting field. To use this, simply inherit from this class and give
#     the model a more meaningful name e.g. InvoiceIDs.
#     """
#     id = BigAutoField(primary_key=True)
#     stub = models.NullBooleanField(null=True, default=True, unique=True)
# 
#     class Meta:
#         abstract = True


import uuid
from django.apps import apps
from django.db import connections, transaction
from django.utils.deconstruct import deconstructible
from django_sharding_library.constants import Backends
from django_sharding_library.models import TableStrategyModel
        from django.conf import settings
        from django.conf import settings
    """
    def get_next_id(self, database=None):
        """
        A function which takes no arguments and returns a new unique identifier.
        """
        raise NotImplementedError


@deconstructible
class TableStrategy(BaseIDGenerationStrategy):
    """
    Uses an autoincrement field, on a TableStrategyModel model `backing_model`
    to generate unique IDs.
    """
    def __init__(self, backing_model_name):
        self.backing_model_name = backing_model_name

    def get_next_id(self, database=None):
        """
        Returns a new unique integer identifier for an object using an
        auto-incrimenting field in the database.
        """
        app_label = self.backing_model_name.split('.')[0]
        app = apps.get_app_config(app_label)
        backing_model = app.get_model(self.backing_model_name[len(app_label) + 1:])

        if not issubclass(backing_model, TableStrategyModel):
            raise ValueError("Unsupported model used for generating IDs")

        backing_table_db = getattr(backing_model, 'database', 'default')

# Path: django_sharding_library/constants.py
# class Backends(object):
#     MYSQL = ('django.db.backends.mysql', 'django.contrib.gis.db.backends.mysql')
#     POSTGRES = ('django.db.backends.postgresql_psycopg2', 'django.db.backends.postgresql', 'django.contrib.gis.db.backends.postgis')
#     SQLITE = ('django.db.backends.sqlite3', 'django.contrib.gis.db.backends.spacialite')
# 
# Path: django_sharding_library/models.py
# class TableStrategyModel(models.Model):
#     """
#     A model for use with the TableStrategy in order to generate ids using an
#     autoincrimenting field. To use this, simply inherit from this class and give
#     the model a more meaningful name e.g. InvoiceIDs.
#     """
#     id = BigAutoField(primary_key=True)
#     stub = models.NullBooleanField(null=True, default=True, unique=True)
# 
#     class Meta:
#         abstract = True


# Path: django_sharding_library/id_generation_strategies.py
import uuid
from django.apps import apps
from django.db import connections, transaction
from django.utils.deconstruct import deconstructible
from django_sharding_library.constants import Backends
from django_sharding_library.models import TableStrategyModel
        from django.conf import settings
        from django.conf import settings

    """
    def get_next_id(self, database=None):
        """
        A function which takes no arguments and returns a new unique identifier.
        """
        raise NotImplementedError


@deconstructible
class TableStrategy(BaseIDGenerationStrategy):
    """
    Uses an autoincrement field, on a TableStrategyModel model `backing_model`
    to generate unique IDs.
    """
    def __init__(self, backing_model_name):
        self.backing_model_name = backing_model_name

    def get_next_id(self, database=None):
        """
        Returns a new unique integer identifier for an object using an
        auto-incrimenting field in the database.
        """
        app_label = self.backing_model_name.split('.')[0]
        app = apps.get_app_config(app_label)
        backing_model = app.get_model(self.backing_model_name[len(app_label) + 1:])

        if not issubclass(backing_model, TableStrategyModel):
            raise ValueError("Unsupported model used for generating IDs")

        backing_table_db = getattr(backing_model, 'database', 'default')

        if settings.DATABASES[backing_table_db]['ENGINE'] in Backends.MYSQL: