This repository has been archived by the owner on Jul 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Move Query templates files into enum
- Loading branch information
Showing
12 changed files
with
44 additions
and
46 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 |
---|---|---|
@@ -1,5 +1,26 @@ | ||
export enum TableTemplatePath { | ||
Candlestick = 'src/database/templates/candlesctick.sql', | ||
Trades = 'src/database/templates/trades.sql', | ||
Orderbook = 'src/database/templates/orderbook.sql', | ||
export enum TableTemplates { | ||
Candlestick = `CREATE TABLE ?? ( | ||
time bigint(20) NOT NULL DEFAULT '0', | ||
open double NOT NULL DEFAULT '0', | ||
high double NOT NULL DEFAULT '0', | ||
low double NOT NULL DEFAULT '0', | ||
close double NOT NULL DEFAULT '0', | ||
volume double NOT NULL DEFAULT '0', | ||
UNIQUE KEY time (time) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;`, | ||
|
||
Orderbook = `CREATE TABLE ?? ( | ||
time bigint(20) NOT NULL, | ||
orderbook json DEFAULT NULL, | ||
PRIMARY KEY (time) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;`, | ||
|
||
Trades = `CREATE TABLE ?? ( | ||
time bigint(20) NOT NULL DEFAULT '0', | ||
side varchar(5) DEFAULT NULL, | ||
quantity double DEFAULT NULL, | ||
price double DEFAULT NULL, | ||
tradeId varchar(30) DEFAULT NULL, | ||
UNIQUE KEY time (time,tradeId) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;`, | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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