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

How do you close a Database Query in Ace Commands #33

Closed
joshuand1990 opened this issue Jun 19, 2016 · 5 comments
Closed

How do you close a Database Query in Ace Commands #33

joshuand1990 opened this issue Jun 19, 2016 · 5 comments
Assignees

Comments

@joshuand1990
Copy link

joshuand1990 commented Jun 19, 2016

const Database = use('Database')

const users = yield Database.connection('mysql').table('users').select('*');
I get my data but the database connection is still open so the command doesn't stop running.

Using Lucid i don't face any issue and can close with Model.activeConnection.client.destroy().

@thetutlage
Copy link
Member

Database.close('mysql')

@joshuand1990
Copy link
Author

Database.close is not a function

using "adonis-lucid": "^2.0.5" and "mysql": "^2.11.1".

@thetutlage
Copy link
Member

Okay seems like you are using the old version of adonis-lucid. I would recommend making use of the dev release for now. Docs for dev release are here http://dev.adonisjs.com/

Dev release will be released as 3.0 on 26th June (which is 6days from now).

As it is a major, there will be bunch of breaking changes. But it will be worth upgrading coz it is going to be stable.

@thetutlage thetutlage self-assigned this Jun 20, 2016
@thetutlage
Copy link
Member

Closing. Please reopen if you can any more questions

@riddict
Copy link

riddict commented Aug 3, 2020

If using i am using two models, the connection wont close and the process will not exit. please help

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