Browse Source

* adding support for MySQL

283
Ovidiu Constantin 13 years ago
parent
commit
4c0f06f39d
  1. 10
      server/electrum.conf.sample
  2. 5
      server/server.py

10
server/electrum.conf.sample

@ -1,5 +1,5 @@
[server]
host = 127.0.0.1
host = localhost
port = 50000
password = secret
banner = Welcome to Electrum!
@ -7,3 +7,11 @@ banner = Welcome to Electrum!
[database]
type = sqlite3
database = electrum.sqlite
# type = MySQLdb
# database = electrum
# username = electrum
# password = secret
# type = psycopg2
# database = electrum

5
server/server.py

@ -509,6 +509,11 @@ if __name__ == '__main__':
conf = DataStore.CONFIG_DEFAULTS
args, argv = readconf.parse_argv( [], conf)
args.dbtype= config.get('database','type')
if args.dbtype == 'sqlite3':
args.connect_args = { 'database' : config.get('database','database') }
elif args.dbtype == 'MySQLdb':
args.connect_args = { 'db' : config.get('database','database'), 'user' : config.get('database','user'), 'passwd' : config.get('database','pass') }
elif args.dbtype == 'psycopg2':
args.connect_args = { 'database' : config.get('database','database') }
store = MyStore(args)

Loading…
Cancel
Save