# Path: django_cassandra_engine/utils.py
# def get_default_cassandra_connection():
#     """
#     Return first default cassandra connection
#     :return:
#     """
#     for alias, conn in get_cassandra_connections():
#         if conn.connection.default:
#             return alias, conn
# 
#     return list(get_cassandra_connections())[0]
# 
# Path: django_cassandra_engine/compat.py



import logging
from cassandra.cqlengine.connection import set_default_connection
from django.db.backends.base.creation import BaseDatabaseCreation
from django_cassandra_engine.utils import get_default_cassandra_connection
from ..compat import create_keyspace_simple, drop_keyspace
        from django.conf import settings
        from django.core.management import call_command




logger = logging.getLogger(__name__)


class CassandraDatabaseCreation(BaseDatabaseCreation):
    def create_test_db(self, verbosity=1, autoclobber=False, **kwargs):
        """
        Creates a test database, prompting the user for confirmation if the
        database already exists. Returns the name of the test database created.
        """
        # Don't import django.core.management if it isn't needed.

        self.connection.connect()

# Path: django_cassandra_engine/utils.py
# def get_default_cassandra_connection():
#     """
#     Return first default cassandra connection
#     :return:
#     """
#     for alias, conn in get_cassandra_connections():
#         if conn.connection.default:
#             return alias, conn
# 
#     return list(get_cassandra_connections())[0]
# 
# Path: django_cassandra_engine/compat.py



# Path: django_cassandra_engine/base/creation.py
import logging
from cassandra.cqlengine.connection import set_default_connection
from django.db.backends.base.creation import BaseDatabaseCreation
from django_cassandra_engine.utils import get_default_cassandra_connection
from ..compat import create_keyspace_simple, drop_keyspace
        from django.conf import settings
        from django.core.management import call_command





logger = logging.getLogger(__name__)


class CassandraDatabaseCreation(BaseDatabaseCreation):
    def create_test_db(self, verbosity=1, autoclobber=False, **kwargs):
        """
        Creates a test database, prompting the user for confirmation if the
        database already exists. Returns the name of the test database created.
        """
        # Don't import django.core.management if it isn't needed.

        self.connection.connect()

        default_alias = get_default_cassandra_connection()[0]