Show More
@@ -484,18 +484,18 b' logview.pylons.util = #eee' | |||||
484 | ######################################################### |
|
484 | ######################################################### | |
485 |
|
485 | |||
486 | # SQLITE [default] |
|
486 | # SQLITE [default] | |
487 |
sqlalchemy. |
|
487 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 | |
488 |
|
488 | |||
489 | # POSTGRESQL |
|
489 | # POSTGRESQL | |
490 |
#sqlalchemy. |
|
490 | #sqlalchemy.url = postgresql://user:pass@localhost/kallithea | |
491 |
|
491 | |||
492 | # MySQL |
|
492 | # MySQL | |
493 |
#sqlalchemy. |
|
493 | #sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 | |
494 |
|
494 | |||
495 | # see sqlalchemy docs for others |
|
495 | # see sqlalchemy docs for others | |
496 |
|
496 | |||
497 |
sqlalchemy. |
|
497 | sqlalchemy.echo = false | |
498 |
sqlalchemy. |
|
498 | sqlalchemy.pool_recycle = 3600 | |
499 |
|
499 | |||
500 | ################################ |
|
500 | ################################ | |
501 | ### ALEMBIC CONFIGURATION #### |
|
501 | ### ALEMBIC CONFIGURATION #### |
@@ -54,7 +54,7 b' utility.' | |||||
54 | If using MySQL, please consult the documentation for the ``mysqldump`` |
|
54 | If using MySQL, please consult the documentation for the ``mysqldump`` | |
55 | utility. |
|
55 | utility. | |
56 |
|
56 | |||
57 |
Look for ``sqlalchemy. |
|
57 | Look for ``sqlalchemy.url`` in your configuration file to determine | |
58 | database type, settings, location, etc. |
|
58 | database type, settings, location, etc. | |
59 |
|
59 | |||
60 |
|
60 |
@@ -31,7 +31,7 b' config = context.config' | |||||
31 | # [alembic] sqlalchemy.url. |
|
31 | # [alembic] sqlalchemy.url. | |
32 | database_url = ( |
|
32 | database_url = ( | |
33 | config.get_main_option('sqlalchemy.url') or |
|
33 | config.get_main_option('sqlalchemy.url') or | |
34 |
config.get_section_option('app:main', 'sqlalchemy. |
|
34 | config.get_section_option('app:main', 'sqlalchemy.url') | |
35 | ) |
|
35 | ) | |
36 |
|
36 | |||
37 | # Configure default logging for Alembic. (This can be overriden by the |
|
37 | # Configure default logging for Alembic. (This can be overriden by the |
@@ -484,21 +484,21 b' logview.pylons.util = #eee' | |||||
484 |
|
484 | |||
485 | %if database_engine == 'sqlite': |
|
485 | %if database_engine == 'sqlite': | |
486 | # SQLITE [default] |
|
486 | # SQLITE [default] | |
487 |
sqlalchemy. |
|
487 | sqlalchemy.url = sqlite:///${here}/kallithea.db?timeout=60 | |
488 |
|
488 | |||
489 | %elif database_engine == 'postgres': |
|
489 | %elif database_engine == 'postgres': | |
490 | # POSTGRESQL |
|
490 | # POSTGRESQL | |
491 |
sqlalchemy. |
|
491 | sqlalchemy.url = postgresql://user:pass@localhost/kallithea | |
492 |
|
492 | |||
493 | %elif database_engine == 'mysql': |
|
493 | %elif database_engine == 'mysql': | |
494 | # MySQL |
|
494 | # MySQL | |
495 |
sqlalchemy. |
|
495 | sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 | |
496 |
|
496 | |||
497 | %endif |
|
497 | %endif | |
498 | # see sqlalchemy docs for others |
|
498 | # see sqlalchemy docs for others | |
499 |
|
499 | |||
500 |
sqlalchemy. |
|
500 | sqlalchemy.echo = false | |
501 |
sqlalchemy. |
|
501 | sqlalchemy.pool_recycle = 3600 | |
502 |
|
502 | |||
503 | <%text>################################</%text> |
|
503 | <%text>################################</%text> | |
504 | <%text>### ALEMBIC CONFIGURATION ####</%text> |
|
504 | <%text>### ALEMBIC CONFIGURATION ####</%text> |
@@ -476,18 +476,18 b' logview.pylons.util = #eee' | |||||
476 | ######################################################### |
|
476 | ######################################################### | |
477 |
|
477 | |||
478 | # SQLITE [default] |
|
478 | # SQLITE [default] | |
479 |
sqlalchemy. |
|
479 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 | |
480 |
|
480 | |||
481 | # POSTGRESQL |
|
481 | # POSTGRESQL | |
482 |
#sqlalchemy. |
|
482 | #sqlalchemy.url = postgresql://user:pass@localhost/kallithea | |
483 |
|
483 | |||
484 | # MySQL |
|
484 | # MySQL | |
485 |
#sqlalchemy. |
|
485 | #sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 | |
486 |
|
486 | |||
487 | # see sqlalchemy docs for others |
|
487 | # see sqlalchemy docs for others | |
488 |
|
488 | |||
489 |
sqlalchemy. |
|
489 | sqlalchemy.echo = false | |
490 |
sqlalchemy. |
|
490 | sqlalchemy.pool_recycle = 3600 | |
491 |
|
491 | |||
492 | ################################ |
|
492 | ################################ | |
493 | ### ALEMBIC CONFIGURATION #### |
|
493 | ### ALEMBIC CONFIGURATION #### |
@@ -93,7 +93,7 b' def load_environment(global_conf, app_co' | |||||
93 | test_index = not int(os.environ.get('KALLITHEA_WHOOSH_TEST_DISABLE', 0)) |
|
93 | test_index = not int(os.environ.get('KALLITHEA_WHOOSH_TEST_DISABLE', 0)) | |
94 | if os.environ.get('TEST_DB'): |
|
94 | if os.environ.get('TEST_DB'): | |
95 | # swap config if we pass enviroment variable |
|
95 | # swap config if we pass enviroment variable | |
96 |
config['sqlalchemy. |
|
96 | config['sqlalchemy.url'] = os.environ.get('TEST_DB') | |
97 |
|
97 | |||
98 | from kallithea.lib.utils import create_test_env, create_test_index |
|
98 | from kallithea.lib.utils import create_test_env, create_test_index | |
99 | from kallithea.tests import TESTS_TMP_PATH |
|
99 | from kallithea.tests import TESTS_TMP_PATH | |
@@ -107,8 +107,8 b' def load_environment(global_conf, app_co' | |||||
107 |
|
107 | |||
108 | # MULTIPLE DB configs |
|
108 | # MULTIPLE DB configs | |
109 | # Setup the SQLAlchemy database engine |
|
109 | # Setup the SQLAlchemy database engine | |
110 |
sa_engine |
|
110 | sa_engine = engine_from_config(config, 'sqlalchemy.') | |
111 |
init_model(sa_engine |
|
111 | init_model(sa_engine) | |
112 |
|
112 | |||
113 | set_available_permissions(config) |
|
113 | set_available_permissions(config) | |
114 | repos_path = make_ui('db').configitems('paths')[0][1] |
|
114 | repos_path = make_ui('db').configitems('paths')[0][1] |
@@ -122,7 +122,7 b' def locked_task(func):' | |||||
122 |
|
122 | |||
123 | def get_session(): |
|
123 | def get_session(): | |
124 | if CELERY_ON: |
|
124 | if CELERY_ON: | |
125 |
engine = engine_from_config(config, 'sqlalchemy. |
|
125 | engine = engine_from_config(config, 'sqlalchemy.') | |
126 | init_model(engine) |
|
126 | init_model(engine) | |
127 | sa = meta.Session() |
|
127 | sa = meta.Session() | |
128 | return sa |
|
128 | return sa |
@@ -395,7 +395,7 b' def handle_git_receive(repo_path, revs, ' | |||||
395 | load_environment(conf.global_conf, conf.local_conf, test_env=False, |
|
395 | load_environment(conf.global_conf, conf.local_conf, test_env=False, | |
396 | test_index=False) |
|
396 | test_index=False) | |
397 |
|
397 | |||
398 |
engine = engine_from_config(conf, 'sqlalchemy. |
|
398 | engine = engine_from_config(conf, 'sqlalchemy.') | |
399 | init_model(engine) |
|
399 | init_model(engine) | |
400 |
|
400 | |||
401 | baseui = make_ui('db') |
|
401 | baseui = make_ui('db') |
@@ -103,5 +103,5 b' class BasePasterCommand(Command):' | |||||
103 | from kallithea.model import init_model |
|
103 | from kallithea.model import init_model | |
104 | from kallithea.lib.utils2 import engine_from_config |
|
104 | from kallithea.lib.utils2 import engine_from_config | |
105 | setup_cache_regions(config) |
|
105 | setup_cache_regions(config) | |
106 |
engine = engine_from_config(config, 'sqlalchemy. |
|
106 | engine = engine_from_config(config, 'sqlalchemy.') | |
107 | init_model(engine) |
|
107 | init_model(engine) |
@@ -632,7 +632,7 b' def create_test_env(repos_test_path, con' | |||||
632 | from kallithea.tests import HG_REPO, GIT_REPO, TESTS_TMP_PATH |
|
632 | from kallithea.tests import HG_REPO, GIT_REPO, TESTS_TMP_PATH | |
633 |
|
633 | |||
634 | # PART ONE create db |
|
634 | # PART ONE create db | |
635 |
dbconf = config['sqlalchemy. |
|
635 | dbconf = config['sqlalchemy.url'] | |
636 | log.debug('making test db %s', dbconf) |
|
636 | log.debug('making test db %s', dbconf) | |
637 |
|
637 | |||
638 | # create test dir if it doesn't exist |
|
638 | # create test dir if it doesn't exist |
@@ -82,7 +82,7 b' class Command(object):' | |||||
82 |
|
82 | |||
83 |
|
83 | |||
84 | def get_session(): |
|
84 | def get_session(): | |
85 |
engine = engine_from_config(conf, 'sqlalchemy. |
|
85 | engine = engine_from_config(conf, 'sqlalchemy.') | |
86 | init_model(engine) |
|
86 | init_model(engine) | |
87 | sa = meta.Session |
|
87 | sa = meta.Session | |
88 | return sa |
|
88 | return sa |
@@ -488,19 +488,19 b' logview.pylons.util = #eee' | |||||
488 | ######################################################### |
|
488 | ######################################################### | |
489 |
|
489 | |||
490 | # SQLITE [default] |
|
490 | # SQLITE [default] | |
491 |
#sqlalchemy. |
|
491 | #sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 | |
492 |
sqlalchemy. |
|
492 | sqlalchemy.url = sqlite:///%(here)s/kallithea_test.sqlite | |
493 |
|
493 | |||
494 | # POSTGRESQL |
|
494 | # POSTGRESQL | |
495 |
#sqlalchemy. |
|
495 | #sqlalchemy.url = postgresql://user:pass@localhost/kallithea | |
496 |
|
496 | |||
497 | # MySQL |
|
497 | # MySQL | |
498 |
#sqlalchemy. |
|
498 | #sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 | |
499 |
|
499 | |||
500 | # see sqlalchemy docs for others |
|
500 | # see sqlalchemy docs for others | |
501 |
|
501 | |||
502 |
sqlalchemy. |
|
502 | sqlalchemy.echo = false | |
503 |
sqlalchemy. |
|
503 | sqlalchemy.pool_recycle = 3600 | |
504 |
|
504 | |||
505 | ################################ |
|
505 | ################################ | |
506 | ### ALEMBIC CONFIGURATION #### |
|
506 | ### ALEMBIC CONFIGURATION #### |
@@ -37,7 +37,7 b' log = logging.getLogger(__name__)' | |||||
37 |
|
37 | |||
38 | def setup_app(command, conf, vars): |
|
38 | def setup_app(command, conf, vars): | |
39 | """Place any commands to setup kallithea here""" |
|
39 | """Place any commands to setup kallithea here""" | |
40 |
dbconf = conf['sqlalchemy. |
|
40 | dbconf = conf['sqlalchemy.url'] | |
41 | dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'], |
|
41 | dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'], | |
42 | tests=False, cli_args=command.options.__dict__) |
|
42 | tests=False, cli_args=command.options.__dict__) | |
43 | dbmanage.create_tables(override=True) |
|
43 | dbmanage.create_tables(override=True) |
@@ -65,7 +65,7 b' temp=$(readlink -f "$(mktemp --tmpdir -d' | |||||
65 | cat <<EOD |
|
65 | cat <<EOD | |
66 | Config file: $config_file |
|
66 | Config file: $config_file | |
67 | EOD |
|
67 | EOD | |
68 |
sed -n -e 's/^sqlalchemy\. |
|
68 | sed -n -e 's/^sqlalchemy\.url *= */Database URL: /p' "$config_file" | |
69 | cat <<EOD |
|
69 | cat <<EOD | |
70 | Working dir: $temp |
|
70 | Working dir: $temp | |
71 | Repository: $source_repo |
|
71 | Repository: $source_repo |
@@ -60,7 +60,7 b' ini_files = [' | |||||
60 | 'archive_cache_dir': '%(here)s/../../data/test/tarballcache', |
|
60 | 'archive_cache_dir': '%(here)s/../../data/test/tarballcache', | |
61 | 'beaker.cache.data_dir': '%(here)s/../../data/test/cache/data', |
|
61 | 'beaker.cache.data_dir': '%(here)s/../../data/test/cache/data', | |
62 | 'beaker.cache.lock_dir': '%(here)s/../../data/test/cache/lock', |
|
62 | 'beaker.cache.lock_dir': '%(here)s/../../data/test/cache/lock', | |
63 |
'sqlalchemy. |
|
63 | 'sqlalchemy.url': 'sqlite:///%(here)s/kallithea_test.sqlite', | |
64 | }, |
|
64 | }, | |
65 | '[handler_console]': { |
|
65 | '[handler_console]': { | |
66 | 'level': 'DEBUG', |
|
66 | 'level': 'DEBUG', |
General Comments 0
You need to be logged in to leave comments.
Login now