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

Database options #13

Closed
xcHades opened this issue Sep 26, 2018 · 3 comments
Closed

Database options #13

xcHades opened this issue Sep 26, 2018 · 3 comments

Comments

@xcHades
Copy link

xcHades commented Sep 26, 2018

Hello!
Can you add the "database" option to specify a database? It should not be a hard issue, just one additional query parameter like http://host:port/?database=my_db&query=....

@TimonKK
Copy link
Owner

TimonKK commented Sep 26, 2018

Hello!
You mean like this:

const ch = new ClickHouse({
 database: 'my_db'
});

// This query will be 'SELECT * FROM my_db.table1'
const rows = await ch.query('SELECT * FROM table1').toPromise();

?

@xcHades
Copy link
Author

xcHades commented Sep 26, 2018

Yes, that's what I mean!

@TimonKK
Copy link
Owner

TimonKK commented Dec 5, 2018

You can use like this:

const ch = new ClickHouse({
	config : {
		database: 'my_db'
	}
});

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