Skip to content

Commit

Permalink
Schema dumper ignores creating schemas that just polutes db/schema. (#59
Browse files Browse the repository at this point in the history
)

* Also, upgrade workflow for latest versions
* Remove replication factor, data_nodes and is_distributed references that belong to multi-node removal.
* Fix reference to toolkit extension name
  • Loading branch information
jonatas authored Apr 9, 2024
1 parent 1e22b24 commit 315cd66
Show file tree
Hide file tree
Showing 15 changed files with 416 additions and 182 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ jobs:
matrix:
ruby: [ '3.1.2' ]
database:
- 'pg14.6-ts2.9.0-patroni-static-primary-latest'
- 'pg13.9-ts2.9-latest'
- 'pg16.2-ts2.14.2-all'
- 'pg15.6-ts2.14.2-all'
- 'pg14.11-ts2.14.2-all'

services:
database:
Expand Down
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ Tick.hypertable
num_dimensions: 1,
num_chunks: 1,
compression_enabled: false,
is_distributed: false,
replication_factor: nil,
data_nodes: nil,
tablespaces: nil>
```

Expand Down Expand Up @@ -436,6 +433,26 @@ config.before(:suite) do
end
```

## Schema Dumper

If you're using the gem with Rails and you want to dump the schema to a file,
The schema dumper will include:

* hypertables configuration
* compression settings
* continuous aggregates (also integrated with Scenic gem)
* compression and retention policies

The idea is try to mimic the last state of art of the database.
The schema dumper will also ignore the `Timescaledb::SchemaDumper::IGNORE_SCHEMAS`
that is an array of schema names that you want to ignore. By default it ignores
all catalog and metadata generated by the extension, but keep in mind you can
change this behavior.

```ruby
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.
Expand Down Expand Up @@ -471,12 +488,6 @@ You can watch all episodes here:
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).

### TODO

Here is a list of functions that would be great to have:

- [ ] Add data nodes support

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jonatas/timescaledb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/jonatas/timescaledb/blob/master/CODE_OF_CONDUCT.md).
Expand Down
6 changes: 1 addition & 5 deletions docs/command_line.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ Tick.hypertable
num_dimensions: 1,
num_chunks: 1,
compression_enabled: false,
is_distributed: false,
replication_factor: nil,
data_nodes: nil,
tablespaces: nil>
```

Expand All @@ -119,8 +116,7 @@ unknown OID 2206: failed to recognize type of 'primary_dimension_type'. It will
range_start_integer: nil,
range_end_integer: nil,
is_compressed: false,
chunk_tablespace: nil,
data_nodes: nil>]
chunk_tablespace: nil>]
```

> Chunks are created by partitioning the hypertable data into one
Expand Down
2 changes: 1 addition & 1 deletion examples/ranking/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.1
3.2.2
6 changes: 3 additions & 3 deletions examples/ranking/Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "2.7.1"
ruby "3.2.2"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.2"
gem "rails", "~> 7.1.3.2"

gem "timescaledb", path: "../../"
gem "pg", "~> 1.1"
gem "puma", "~> 5.0"
gem "puma", "~> 6.0"
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]

# Reduces boot times through caching; required in config/boot.rb
Expand Down
Loading

0 comments on commit 315cd66

Please sign in to comment.