entc: add postgres dialect for sql storage driver options

Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/123

Reviewed By: alexsn

Differential Revision: D18117641

fbshipit-source-id: 8e520a1b1f70c7bea70f8a37ac698116e98a804e
This commit is contained in:
Ariel Mashraki
2019-10-24 10:47:15 -07:00
committed by Facebook Github Bot
parent d5c111b35a
commit e493574c83
64 changed files with 189 additions and 189 deletions

View File

@@ -48,7 +48,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err

View File

@@ -44,7 +44,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err

View File

@@ -48,7 +48,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err

View File

@@ -44,7 +44,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err

View File

@@ -44,7 +44,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err

View File

@@ -48,7 +48,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err

View File

@@ -44,7 +44,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err

View File

@@ -48,7 +48,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err

View File

@@ -44,7 +44,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err

View File

@@ -44,7 +44,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err

View File

@@ -52,7 +52,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err

View File

@@ -52,7 +52,7 @@ func NewClient(opts ...Option) *Client {
// Optional parameters can be added for configuring the client.
func Open(driverName, dataSourceName string, options ...Option) (*Client, error) {
switch driverName {
case dialect.MySQL, dialect.SQLite:
case dialect.MySQL, dialect.Postgres, dialect.SQLite:
drv, err := sql.Open(driverName, dataSourceName)
if err != nil {
return nil, err