-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove hard-coded column names in SQL queries (#20)
* Move column mappings to query.ts * Slightly better type * Document newVisitor, newSession columns
- Loading branch information
1 parent
4bade00
commit 86e6514
Showing
2 changed files
with
40 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export interface ColumnMappingsType { | ||
[key: string]: string | ||
} | ||
|
||
/** | ||
* This maps logical column names to the actual column names in the data store. | ||
*/ | ||
export const ColumnMappings: ColumnMappingsType = { | ||
/** | ||
* blobs | ||
*/ | ||
host: "blob1", | ||
userAgent: "blob2", | ||
path: "blob3", | ||
country: "blob4", | ||
referrer: "blob5", | ||
browserName: "blob6", | ||
deviceModel: "blob7", | ||
siteId: "blob8", | ||
|
||
/** | ||
* doubles | ||
*/ | ||
|
||
// this record is a new visitor (every 24h) | ||
newVisitor: "double1", | ||
|
||
// this record is a new session (resets after 30m inactivity) | ||
newSession: "double2", | ||
}; |