testcontainers-python
testcontainers-python copied to clipboard
TimeScaleDb container
TimeScaleDb Container not available. is that any plan to add that? Thanks
Not planned at the moment, but PRs are welcome.
sure.. Will do that..
It wouldn't be necessary to create a separate module/client for a TimescaleDB container since TimescaleDB is just an extension on top of PostgreSQL (see here). Users of the TimescaleDB container can make use of PostgresDB container client.
Example:
timescaled_container = PostgresContainer('timescale/timescaledb:latest-pg12')
with timescaled_container as timescaled:
e = sqlalchemy.create_engine(timescaled.get_connection_url())
e.execute('''
CREATE TABLE stocks_real_time (
time TIMESTAMPTZ NOT NULL,
symbol TEXT NOT NULL,
price DOUBLE PRECISION NULL,
day_volume INT NULL
);
''')
e.execute('''
SELECT create_hypertable('stocks_real_time','time');
''')
I think we can close this issue :)