davydog187 / timescale Goto Github PK
View Code? Open in Web Editor NEWTimescaleDB made easy with Ecto
Home Page: https://hexdocs.pm/timescale/Timescale.html
License: Apache License 2.0
TimescaleDB made easy with Ecto
Home Page: https://hexdocs.pm/timescale/Timescale.html
License: Apache License 2.0
Automate the publishing of this repo to hex.pm when a github release is created. We can follow what we did for AvroEx.
Additionally, we need to configure the package so that the priv/
directory is not included, as we have added migrations that are intended solely for test purposes.
From the mix help hex.publish
docs
โข :files - List of files and directories to include in the package, can
include wildcards. Defaults to ["lib", "priv", "mix.exs", "README*",
"readme*", "LICENSE*", "license*", "CHANGELOG*", "changelog*", "src"].
We have a function enable_hypertable_compression/2
which corresponds to an alter table, see the timescale docs
Currently we're only allowing you to pass the column name, but we should support the order and nulls rules as well. See below ๐๐ผ
ALTER TABLE <table_name> SET (timescaledb.compress, timescaledb.compress_orderby = '<column_name> [ASC | DESC] [ NULLS { FIRST | LAST } ] [, ...]',
timescaledb.compress_segmentby = '<column_name> [, ...]'
);
The risk here is so minimal because I doubt there's anyone creating tables from user input :) However, i do think we should be properly escaping any data into queries.
https://github.com/bitfo/timescale/blob/main/lib/timescale/migration.ex#L35
Validate if you can use Date
, DateTime
, and NaiveDateTime
directly in ecto queries, e.g.
now = Date.utc_today()
from(t in Table, where: t.date < ^now) |> Repo.all()
If you can do this we should make sure it is correctly supported
Look into what we want to support in Continuous Aggregates.
Since setting a continuous aggregate up involves materialized view syntax, we may want to just have documentation for setting up CAs in Ecto, and then add the following functions
Currently we are only supporting a single column by string/atom, e.g.
enable_hypertable_compression(:my_table, segment_by: :column_a)
But we should be allowing a list of columns
enable_hypertable_compression(:my_table, segment_by: [:column_a, :column_b])
We should allow for optional params to be type casted since TimescaleDB allows for many different type args like in the time_bucket_ng
function: https://docs.timescale.com/api/latest/hyperfunctions/time_bucket_ng/#required-arguments
Issue is from this todo: https://github.com/bitfo/timescale/pull/7/files/04432106e4c8709f7d5e122862e649fd36e90cff#diff-6d0e22f3d21d3b1f14d00c23a58aaf6c2f75ead03982637080cde9920c73ebfaR31-R33
TODO figure out a better way to handle "INTERVAL" grammar for compress_after
This issue is being created from a TODO in the code to enhance INTERVAL support within the add_compression_policy/2
macro.
https://github.com/bitfo/timescale/blob/main/lib/timescale/migration.ex#L59
For functions like time_bucket, optional arguments can be passed as named arguments, but they can be passed positionally.
Should we support both? CC: @akoutmos
SELECT time_bucket('5 minutes', time, '-2.5 minutes'::INTERVAL) + '2.5 minutes'
AS five_min, avg(cpu)
FROM metrics
GROUP BY five_min
ORDER BY five_min DESC LIMIT 10;
The supported optional parameters are known ahead of time for the TimescaleDB functions. We should add some validation so that users are alerted about invalid options.
Add support for create and managing hypertables and chunks
From @akoutmos in slack
akoutmos - We should also add an issue for integration tests in CI
the assert_sql assertion is good for unit testing, but would be great to get some real TimescaleDB integration tests to validate that the functions not only produce expected SQL, but also return the expected results
๐ฏ that we should have integration tests here. The main issue will be finding a way to have ecto migrations without shipping them in the library. We may just need a publishing script that wipes the priv
directory when we do mix hex.publish
TODO add "if_not_exists" as a named option
This issue is being created from a TODO in the code to update the add_compression_policy/2
macro to support optional opts to include if_not_exists
.
https://github.com/bitfo/timescale/blob/main/lib/timescale/migration.ex#L59
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.