xormplus.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package xorm
  2. // "fmt"
  3. const (
  4. MSSQL_DRIVER string = "mssql"
  5. MSSQL_ODBC_DRIVER string = "odbc"
  6. MYSQL_DRIVER string = "mysql"
  7. MYMYSQL_DRIVER string = "mymysql"
  8. POSTGRESQL_DRIVER string = "postgres"
  9. OCI8_DRIVER string = "oci8"
  10. GORACLE_DRIVER string = "goracle"
  11. SQLITE3_DRIVER string = "sqlite3"
  12. )
  13. func NewOracle(driverName string, dataSourceName string) (*Engine, error) {
  14. return NewEngine(driverName, dataSourceName)
  15. }
  16. func NewMSSQL(driverName string, dataSourceName string) (*Engine, error) {
  17. return NewEngine(driverName, dataSourceName)
  18. }
  19. func NewMySQL(driverName string, dataSourceName string) (*Engine, error) {
  20. return NewEngine(driverName, dataSourceName)
  21. }
  22. func NewPostgreSQL(dataSourceName string) (*Engine, error) {
  23. return NewEngine(POSTGRESQL_DRIVER, dataSourceName)
  24. }
  25. func NewSqlite3(dataSourceName string) (*Engine, error) {
  26. return NewEngine(SQLITE3_DRIVER, dataSourceName)
  27. }
  28. func NewDB(driverName string, dataSourceName string) (*Engine, error) {
  29. return NewEngine(driverName, dataSourceName)
  30. }