176 options = ( |
176 options = ( |
177 ('db-driver', |
177 ('db-driver', |
178 {'type' : 'string', |
178 {'type' : 'string', |
179 'default': 'postgres', |
179 'default': 'postgres', |
180 'help': 'database driver (postgres or sqlite)', |
180 'help': 'database driver (postgres or sqlite)', |
181 'group': 'native-source', 'inputlevel': 1, |
181 'group': 'native-source', 'level': 1, |
182 }), |
182 }), |
183 ('db-host', |
183 ('db-host', |
184 {'type' : 'string', |
184 {'type' : 'string', |
185 'default': '', |
185 'default': '', |
186 'help': 'database host', |
186 'help': 'database host', |
187 'group': 'native-source', 'inputlevel': 1, |
187 'group': 'native-source', 'level': 1, |
188 }), |
188 }), |
189 ('db-port', |
189 ('db-port', |
190 {'type' : 'string', |
190 {'type' : 'string', |
191 'default': '', |
191 'default': '', |
192 'help': 'database port', |
192 'help': 'database port', |
193 'group': 'native-source', 'inputlevel': 1, |
193 'group': 'native-source', 'level': 1, |
194 }), |
194 }), |
195 ('db-name', |
195 ('db-name', |
196 {'type' : 'string', |
196 {'type' : 'string', |
197 'default': Method('default_instance_id'), |
197 'default': Method('default_instance_id'), |
198 'help': 'database name', |
198 'help': 'database name', |
199 'group': 'native-source', 'inputlevel': 0, |
199 'group': 'native-source', 'level': 0, |
200 }), |
200 }), |
201 ('db-user', |
201 ('db-user', |
202 {'type' : 'string', |
202 {'type' : 'string', |
203 'default': CubicWebNoAppConfiguration.mode == 'user' and getlogin() or 'cubicweb', |
203 'default': CubicWebNoAppConfiguration.mode == 'user' and getlogin() or 'cubicweb', |
204 'help': 'database user', |
204 'help': 'database user', |
205 'group': 'native-source', 'inputlevel': 0, |
205 'group': 'native-source', 'level': 0, |
206 }), |
206 }), |
207 ('db-password', |
207 ('db-password', |
208 {'type' : 'password', |
208 {'type' : 'password', |
209 'default': '', |
209 'default': '', |
210 'help': 'database password', |
210 'help': 'database password', |
211 'group': 'native-source', 'inputlevel': 0, |
211 'group': 'native-source', 'level': 0, |
212 }), |
212 }), |
213 ('db-encoding', |
213 ('db-encoding', |
214 {'type' : 'string', |
214 {'type' : 'string', |
215 'default': 'utf8', |
215 'default': 'utf8', |
216 'help': 'database encoding', |
216 'help': 'database encoding', |
217 'group': 'native-source', 'inputlevel': 1, |
217 'group': 'native-source', 'level': 1, |
218 }), |
218 }), |
219 ) |
219 ) |
220 |
220 |
221 def __init__(self, repo, appschema, source_config, *args, **kwargs): |
221 def __init__(self, repo, appschema, source_config, *args, **kwargs): |
222 SQLAdapterMixIn.__init__(self, source_config) |
222 SQLAdapterMixIn.__init__(self, source_config) |