-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Brian/uc 35 merge tables ch #1515
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
❌ Deploy Preview for heartfelt-souffle-72e1df failed.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple quetsions.
arr.push(`and ${table}.${key}=$${params.length + 1}`); | ||
params.push(decodeURIComponent(filter)); | ||
} | ||
arr.push(`and ${key}=$${params.length + 1}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is all same logic as above, they should be combined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged logic.
lib/session.js
Outdated
@@ -31,11 +34,11 @@ export async function getSession(req) { | |||
let websiteId = null; | |||
|
|||
// Check if website exists | |||
if (redis.client) { | |||
if (isRedis) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes less sense. If "we have a redis client" vs "we are a redis?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated language.
created_at: getDateFormat(new Date()), | ||
url: url?.substring(0, URL_LENGTH), | ||
event_name: event_name?.substring(0, EVENT_NAME_LENGTH), | ||
event_data: JSON.stringify(event_data), | ||
...sessionArgs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are sessionArgs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we pass the entire session object now, where sessionArgs is the rest of the session data ( hostname, browser, os, device, language). Country is the only property that needs special care.
${column !== 'event_name' ? `and event_name = ''` : ''} | ||
and ${getBetweenDates('created_at', startDate, endDate)} | ||
${pageviewQuery} | ||
${sessionQuery} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work without knowing you need to join session?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
joinSession only needs to occur if data is collected outside of the primary table being collected on. Now that everything is merged into 1 table, a join never needs to occur.
Merge session/pageview/event for CH database.