Open stablishes a new connection to a SQL server.
(connURL db.ConnectionURL)
| 71 | |
| 72 | // Open stablishes a new connection to a SQL server. |
| 73 | func Open(connURL db.ConnectionURL) (db.Session, error) { |
| 74 | ctx := context.Background() |
| 75 | settings := db.NewSettings() |
| 76 | |
| 77 | d := &Source{ |
| 78 | Settings: settings, |
| 79 | ctx: ctx, |
| 80 | } |
| 81 | if err := d.Open(connURL); err != nil { |
| 82 | return nil, fmt.Errorf("Open: %w", err) |
| 83 | } |
| 84 | |
| 85 | return d, nil |
| 86 | } |
| 87 | |
| 88 | func (s *Source) TxContext(context.Context, func(tx db.Session) error, *sql.TxOptions) error { |
| 89 | return db.ErrNotSupportedByAdapter |