Skip to content
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

Bump version and add .lock updates #69

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 43 additions & 29 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,58 +1,72 @@
PATH
remote: .
specs:
timescaledb (0.2.8)
timescaledb (0.3.0)
activerecord
activesupport
pg (~> 1.2)

GEM
remote: https://rubygems.org/
specs:
activemodel (7.0.4.3)
activesupport (= 7.0.4.3)
activerecord (7.0.4.3)
activemodel (= 7.0.4.3)
activesupport (= 7.0.4.3)
activesupport (7.0.4.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
activemodel (7.2.1)
activesupport (= 7.2.1)
activerecord (7.2.1)
activemodel (= 7.2.1)
activesupport (= 7.2.1)
timeout (>= 0.4.0)
activesupport (7.2.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
base64 (0.2.0)
bigdecimal (3.1.8)
coderay (1.1.3)
concurrent-ruby (1.2.2)
database_cleaner-active_record (2.1.0)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
database_cleaner-active_record (2.2.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
diff-lcs (1.5.0)
dotenv (2.8.1)
gemika (0.8.1)
i18n (1.13.0)
diff-lcs (1.5.1)
dotenv (3.1.2)
drb (2.2.1)
gemika (0.8.3)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
method_source (1.0.0)
minitest (5.18.0)
pg (1.5.6)
logger (1.6.1)
method_source (1.1.0)
minitest (5.25.1)
pg (1.5.8)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
rake (12.3.3)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.1)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (~> 3.13.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.12.5)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
securerandom (0.3.1)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.scenic.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
timescaledb (0.2.8)
timescaledb (0.2.9)
activerecord
activesupport
pg (~> 1.2)
Expand Down
59 changes: 49 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -515,26 +515,66 @@ Timescaledb::SchemaDumper::IGNORE_SCHEMAS << "ignore_my_schema_too"

## Development

After checking out the repo, run `bin/setup` to install the development dependencies. Then, `bundle exec rake test:setup` to setup the test database and tables. Finally, run `bundle exec rake` to run the tests.
After checking out the repo, run `bin/setup` to install the development dependencies.
Then, `bundle exec rake test:setup` to setup the test database and tables.
Finally, run `bundle exec rake` to run the tests matrix or `bundle exec rspec` to
run the tests on a single instance.

You can also run `tsdb` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
### Setup the database for testing

You can create a `.env` file locally to run tests locally. Make sure to put your
own credentials there!
If you don't have timescaledb running locally, just run it with docker:

```bash
PG_URI_TEST="postgres://<user>@localhost:5432/<dbname>"
docker run -d --rm -it \
-e POSTGRES_HOST_AUTH_METHOD=trust \
-p 5432:5432 \
timescale/timescaledb-ha:pg16
```

You can put some postgres URI directly as a parameter of
`tsdb`. Here is an example from the console:
Then, use `createdb` to setup the database for the tests:

```bash
tsdb "postgres://<user>@localhost:5432/timescaledb_test"
createdb -h localhost -U postgres timescaledb_test
```

Now, just define the .env file with the connection string:

```bash
export PG_URI_TEST="postgres://postgres@localhost:5432/timescaledb_test"
```

And run the tests:

```bash
bundle exec rake test
```

# Installing the gem locally

To install this gem onto your local machine, run `bundle exec rake install`.
To release a new version, update the version number in `version.rb`, and then run
`bundle exec rake release`, which will create a git tag for the version, push
git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

# Learning

If you want to learn more about TimescaleDB, you can check the official
[TimescaleDB](https://docs.timescale.com) documentation.

I created several posts on my personal blog about TimescaleDB and how to use it
with Ruby:

* <https://ideia.me/using-the-timescale-gem-with-ruby>
* <https://ideia.me/hierarchical-continuous-aggregates-with-ruby>
* <https://ideia.me/timescale-continuous-aggregates-with-ruby>
* <https://ideia.me/two-ways-to-notify-new-data-from-timescaledb-continuous-aggregates>
* <https://ideia.me/my-first-contribution-to-rubygems>

And the official docs for the gem:

* https://jonatas.github.io/timescaledb/

## More resources

This library was started on [twitch.tv/timescaledb](https://twitch.tv/timescaledb).
Expand All @@ -544,7 +584,6 @@ You can watch all episodes here:
2. [Extending ActiveRecord with Timescale Helpers](https://www.youtube.com/watch?v=IEyJIHk1Clk).
3. [Setup Hypertables for Rails testing environment](https://www.youtube.com/watch?v=wM6hVrZe7xA).
4. [Packing the code to this repository](https://www.youtube.com/watch?v=CMdGAl_XlL4).
4. [the code to this repository](https://www.youtube.com/watch?v=CMdGAl_XlL4).
5. [Working with Timescale continuous aggregates](https://youtu.be/co4HnBkHzVw).
6. [Creating the command-line application in Ruby to explore the Timescale API](https://www.youtube.com/watch?v=I3vM_q2m7T0).

Expand Down
2 changes: 1 addition & 1 deletion lib/timescaledb/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Timescaledb
VERSION = '0.2.9'
VERSION = '0.3.0'
end
4 changes: 1 addition & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
require_relative "support/active_record/models"
require_relative "support/active_record/schema"

Dotenv.load! if File.exists?(".env")

# Establish a connection for testing
ENV['PG_URI_TEST'] || Dotenv.load!

ActiveRecord::Base.establish_connection(ENV['PG_URI_TEST'])
Timescaledb.establish_connection(ENV['PG_URI_TEST'])
Expand Down
Loading