Skip to content

Now, how do I use SQLite executing a SQL statement?(0.11.2) #626

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

Closed
yangxincai opened this issue Apr 7, 2017 · 3 comments
Closed

Now, how do I use SQLite executing a SQL statement?(0.11.2) #626

yangxincai opened this issue Apr 7, 2017 · 3 comments

Comments

@yangxincai
Copy link

The sample can't perform in the document
i use:

try db.prepare(query: QueryType)

I need a example available,thanks

@yasinkavakli
Copy link

You can find the example to run an SQL statement under the "Usage" part of the README.

let stmt = try db.prepare("INSERT INTO users (email) VALUES (?)")
for email in ["[email protected]", "[email protected]"] {
    try stmt.run(email)
}

So after preparing the statement with try db.prepare(SQLStatement) you need to run the statement with try statement.run()

@yangxincai
Copy link
Author

Thank you for your answer,I understand and solved the problem

@yasinkavakli
Copy link

yasinkavakli commented Apr 7, 2017

Glad that I could help. I'm not a contributor or so, just another user which had the same issue and solved it.

If the issue is solved, someone could close it.

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

2 participants