Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odbc: Support connection with attribute key-value pairs #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

huangqinjin
Copy link

connect() now accepts an attribute table to construct a connection string for SQLDriverConnect(). It supports three forms now:

  1. The original form
connect(source, user, pass)
  1. Connect with the DSN keyword
connect {
  DSN = source,
  UID = user,
  PWD = pass,
}

or

connect({ DSN = source }, user, pass)
  1. Connect with the DRIVER keyword
connect {
  DRIVER = "SQL Server",
  SERVER = ".\\SQLEXPRESS",
  UID = user,
  PWD = pass,
}

or

connect({
  DRIVER = "SQL Server",
  SERVER = ".\\SQLEXPRESS",
}, user, pass)

`connect()` now accepts an attribute table to construct a connection string
for `SQLDriverConnect()`. It supports three forms now:

1. The original form
```lua
connect(source, user, pass)
```

2. Connect with the DSN keyword
```lua
connect {
  DSN = source,
  UID = user,
  PWD = pass,
}
```
or
```lua
connect({ DSN = source }, user, pass)
```

3. Connect with the DRIVER keyword
```lua
connect {
  DRIVER = "SQL Server",
  SERVER = ".\\SQLEXPRESS",
  UID = user,
  PWD = pass,
}
```
or
```lua
connect({
  DRIVER = "SQL Server",
  SERVER = ".\\SQLEXPRESS",
}, user, pass)
```
@huangqinjin huangqinjin force-pushed the odbc-connection-string branch from 908ad7b to 91dcfca Compare October 29, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant