Skip to content

Example doesn't work ... #988

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
SieczkowskiAL opened this issue Feb 8, 2020 · 1 comment · Fixed by #993
Closed

Example doesn't work ... #988

SieczkowskiAL opened this issue Feb 8, 2020 · 1 comment · Fixed by #993

Comments

@SieczkowskiAL
Copy link

Hi,

Error in example ... how correct ?
Captura de Tela 2020-02-07 às 23 25 39

@nathanfallet
Copy link
Collaborator

Because your db object is defined in the do structure, you need to wrap everything in it (db is created in it so stays in it)

do {
    let db = try Connection("financeiro.db")

    // Move your code here
    let users = Table("users")
    // ...
} catch {
    print (error)
}

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

Successfully merging a pull request may close this issue.

2 participants