Revision 1926
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
45 | 45 |
|
46 | 46 |
##### Database connections |
47 | 47 |
|
48 |
db_config_names = ['engine', 'host', 'user', 'password', 'database'] |
|
49 |
|
|
48 | 50 |
db_engines = { |
49 | 51 |
'MySQL': ('MySQLdb', {'password': 'passwd', 'database': 'db'}), |
50 | 52 |
'PostgreSQL': ('psycopg2', {}), |
bin/map | ||
---|---|---|
83 | 83 |
opts.get_env_var('profile_to', None, env_names) # add to env_names |
84 | 84 |
|
85 | 85 |
# DB |
86 |
db_config_names = ['engine', 'host', 'user', 'password', 'database'] |
|
87 | 86 |
def get_db_config(prefix): |
88 |
return opts.get_env_vars(db_config_names, prefix, env_names) |
|
87 |
return opts.get_env_vars(sql.db_config_names, prefix, env_names)
|
|
89 | 88 |
in_db_config = get_db_config('in') |
90 | 89 |
out_db_config = get_db_config('out') |
91 | 90 |
in_is_db = 'engine' in in_db_config |
Also available in: Unified diff
Moved db_config_names from bin/map to sql.py so it can be used by other scripts as well