This repository was archived by the owner on Nov 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Switch ClickHouse driver #128
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ad2d6c5
Use driver @posthog/clickhouse instead of clickhouse
Twixes 76e4c0b
Update CH querying
Twixes 2f9f2b3
Merge branch 'ingestion-save' into other-clickhouse-driver
Twixes 4bf0b93
Fix clickhouseQuery usage
Twixes 41f3fc5
Don't quote 64-bit ints in JSON from CH
Twixes ed0fe45
Merge branch 'ingestion-save' into other-clickhouse-driver
Twixes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,24 @@ | ||
| import { defaultConfig } from '../../src/config' | ||
| import { ClickHouse } from 'clickhouse' | ||
| import ClickHouse from '@posthog/clickhouse' | ||
| import { PluginsServerConfig } from '../../src/types' | ||
|
|
||
| export async function resetTestDatabaseClickhouse(extraServerConfig: Partial<PluginsServerConfig>): Promise<void> { | ||
| const config = { ...defaultConfig, ...extraServerConfig } | ||
| const clickhouse = new ClickHouse({ | ||
| url: `http://$${config.CLICKHOUSE_HOST}`, | ||
| host: config.CLICKHOUSE_HOST, | ||
| port: 8123, | ||
| config: { | ||
| dataObjects: true, | ||
| queryOptions: { | ||
| database: config.CLICKHOUSE_DATABASE, | ||
| output_format_json_quote_64bit_integers: false, | ||
| }, | ||
| }) | ||
| await clickhouse.query('TRUNCATE events').toPromise() | ||
| await clickhouse.query('TRUNCATE events_mv').toPromise() | ||
| await clickhouse.query('TRUNCATE person').toPromise() | ||
| await clickhouse.query('TRUNCATE person_distinct_id').toPromise() | ||
| await clickhouse.query('TRUNCATE person_mv').toPromise() | ||
| await clickhouse.query('TRUNCATE person_static_cohort').toPromise() | ||
| await clickhouse.query('TRUNCATE session_recording_events').toPromise() | ||
| await clickhouse.query('TRUNCATE session_recording_events_mv').toPromise() | ||
| await clickhouse.querying('TRUNCATE events') | ||
| await clickhouse.querying('TRUNCATE events_mv') | ||
| await clickhouse.querying('TRUNCATE person') | ||
| await clickhouse.querying('TRUNCATE person_distinct_id') | ||
| await clickhouse.querying('TRUNCATE person_mv') | ||
| await clickhouse.querying('TRUNCATE person_static_cohort') | ||
| await clickhouse.querying('TRUNCATE session_recording_events') | ||
| await clickhouse.querying('TRUNCATE session_recording_events_mv') | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.