Ingen beskrivning
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sqlsettings.py 943B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # -*- coding: utf-8 -*-
  2. class SQLSettings(object):
  3. DEFAULT_HOSTNAME = 'localhost'
  4. dbms_list = {
  5. 'postgresql': {
  6. 'driver': 'psycopg2',
  7. 'encoding': 'utf8',
  8. },
  9. 'mysql': {
  10. 'driver': 'pymysql',
  11. 'encoding': 'utf8',
  12. },
  13. 'sqlite': {
  14. 'driver': 'pysqlite',
  15. 'encoding': 'utf8',
  16. },
  17. }
  18. DB_READ_CONNECTION_NAME = 'default'
  19. DB_WRITE_CONNECTION_NAME = 'default'
  20. querystrings = {
  21. 'add_column': {
  22. 'default': 'ALTER TABLE %s ADD COLUMN %s %s'
  23. },
  24. 'alter_column': {
  25. 'postgresql': 'ALTER TABLE %s ALTER COLUMN %s TYPE %s',
  26. 'mysql': 'ALTER TABLE %s ALTER COLUMN %s %s'
  27. },
  28. 'drop_column': {
  29. 'default': 'ALTER TABLE %s DROP COLUMN %s'
  30. }
  31. }
  32. ACTION_TYPE_WRITE = 'write'
  33. ACTION_TYPE_READ = 'read'