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

Query parameters that are not in SQLite3 pragmas list #768

Open
tredoe opened this issue Dec 16, 2019 · 12 comments
Open

Query parameters that are not in SQLite3 pragmas list #768

tredoe opened this issue Dec 16, 2019 · 12 comments

Comments

@tredoe
Copy link

tredoe commented Dec 16, 2019

I have not found the next pragmas: loc, mutex and txlock in the list of pragmas.
So, if they are only used by "go-sqlite3", please indicate it.

@mattn
Copy link
Owner

mattn commented Dec 17, 2019

@tredoe
Copy link
Author

tredoe commented Dec 17, 2019

I'm supposing that you refer to the next line:

This library supports dsn options of SQLite itself and provides additional options.

But the issue is that it don't say which parameters have been added for the driver.

@rittneje
Copy link
Collaborator

@tredoe I think you are conflating URI options with pragmas. They are not the same thing. The URI options supported by SQLite itself are listed here.

Basically, any options in the table in this library's README that start with an underscore were added by this library. But I don't understand why the distinction matters to you.

@tredoe
Copy link
Author

tredoe commented Dec 17, 2019

@rittneje I'm refering to pragmas like has been said clearly in the title.

I know that all options that start with an underscore have been added to be passed like pragmas except three of them which are not in the pragma list.

@mattn
Copy link
Owner

mattn commented Dec 17, 2019

Query parameters are not same in the list SQLite3 supported since query parameters have some meanings for easily usage like txlock.

@rittneje
Copy link
Collaborator

@tredoe Again, query parameters are not pragmas. Thus the title of your post does not make any sense. In fact, I don't believe that any of the query parameters provided by SQLite itself have pragma equivalents.

@mattn already provided you the list of query parameters supported by this library. You already have the list of pragmas supported by SQLite in your original post. So I don't know what it is you are looking for. What exactly are you trying to do?

@tredoe
Copy link
Author

tredoe commented Dec 17, 2019

Again, query parameters are not pragmas. Thus the title of your post does not make any sense. In fact, I don't believe that any of the query parameters provided by SQLite itself have pragma equivalents.

This driver is using query parameters that start with an underscore to pass them to the driver like pragms. Right?

@tredoe
Copy link
Author

tredoe commented Dec 17, 2019

When I use a DBMS driver, I want to know which parameters are used by the DBMS and which has been added by the driver author; because when I have to use a DBMS driver in other language, I'll know which code (related to query parameters) will can add without problem (at writing from a language to another one).

@mattn
Copy link
Owner

mattn commented Dec 17, 2019

This driver is using query parameters that start with an underscore to pass them to the driver like pragms. Right?

Query parameters with an underscore are not passed to SQLite3 directly.

@tredoe
Copy link
Author

tredoe commented Dec 17, 2019

Query parameters with an underscore are not passed to SQLite3 directly.

Then, how are they used and which is the reason to have been added?

@mattn
Copy link
Owner

mattn commented Dec 17, 2019

As you point in top of this conversation, sqlite3 does not support loc, mutex and txlock. So all of Go users must write code to run these pragmas.

_, err = conn.Exec(fmt.Sprintf("pragma xxx=%d", xxx)
if err != nil {
    // error handling
}

So I added few query options to be possible to add them easily and these query parameters are prefixed with an underscore to avoid conflict with official query parameters.

@mattn
Copy link
Owner

mattn commented Dec 17, 2019

For the description of adding specific query parameter, please find-out from github issues or commit-log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants