Skip to content

Commit

Permalink
Dropped support for MongoDB
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Sep 20, 2023
1 parent 9f580c9 commit 0c8989c
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 127 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,7 @@
- Fixed `async` option
- Fixed run now button for cached queries
- Dropped support for Ruby < 3 and Rails < 6.1
- Dropped support for MongoDB
- Dropped support for R anomaly detection

## 2.6.5 (2022-08-31)
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Expand Up @@ -21,7 +21,6 @@ gem "sprockets-rails"
# gem "hexspace"
# gem "ignite-client"
# gem "influxdb"
# gem "mongo"
# gem "mysql2"
# gem "neo4j-core"
# gem "odbc_adapter"
Expand Down
25 changes: 0 additions & 25 deletions README.md
Expand Up @@ -168,16 +168,6 @@ GRANT SELECT, SHOW VIEW ON dbname.* TO 'blazer'@'127.0.0.1';
FLUSH PRIVILEGES;
```

### MongoDB

Create a user with read-only permissions:

```javascript
db.createUser({user: "blazer", pwd: "secret", roles: ["read"]})
```

Also, make sure authorization is enabled when you start the server.

## Sensitive Data

If your database contains sensitive or personal data, check out [Hypershield](https://github.com/ankane/hypershield) to shield it.
Expand Down Expand Up @@ -576,7 +566,6 @@ data_sources:
- [Google BigQuery](#google-bigquery)
- [IBM DB2 and Informix](#ibm-db2-and-informix)
- [InfluxDB](#influxdb)
- [MongoDB](#mongodb-1)
- [MySQL](#mysql-1)
- [Neo4j](#neo4j)
- [OpenSearch](#opensearch)
Expand Down Expand Up @@ -790,20 +779,6 @@ data_sources:

Use a [read-only user](https://docs.influxdata.com/influxdb/v1.8/administration/authentication_and_authorization/). Supports [InfluxQL](https://docs.influxdata.com/influxdb/v1.8/query_language/explore-data/).

### MongoDB

*Requires MongoDB < 4.2 at the moment*

Add [mongo](https://github.com/mongodb/mongo-ruby-driver) to your Gemfile and set:

```yml
data_sources:
my_source:
url: mongodb://user:password@hostname:27017/database
```

Use a [read-only user](#mongodb).

### MySQL

Add [mysql2](https://github.com/brianmario/mysql2) to your Gemfile (if it’s not there) and set:
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -10,7 +10,7 @@ end

%w(
athena bigquery cassandra drill druid elasticsearch
hive ignite influxdb mongodb mysql neo4j opensearch
hive ignite influxdb mysql neo4j opensearch
postgresql presto redshift salesforce snowflake
soda spark sqlite sqlserver
).each do |adapter|
Expand Down
18 changes: 8 additions & 10 deletions app/views/blazer/queries/show.html.erb
Expand Up @@ -62,13 +62,11 @@
</script>
<% end %>

<% unless %w(mongodb).include?(Blazer.data_sources[@query.data_source].adapter) %>
<script>
// do not highlight really long queries
// this can lead to performance issues
var code = $("#code code")
if (code.text().length < 10000) {
hljs.highlightElement(code.get(0))
}
</script>
<% end %>
<script>
// do not highlight really long queries
// this can lead to performance issues
var code = $("#code code")
if (code.text().length < 10000) {
hljs.highlightElement(code.get(0))
}
</script>
1 change: 0 additions & 1 deletion lib/blazer.rb
Expand Up @@ -27,7 +27,6 @@
require_relative "blazer/adapters/hive_adapter"
require_relative "blazer/adapters/ignite_adapter"
require_relative "blazer/adapters/influxdb_adapter"
require_relative "blazer/adapters/mongodb_adapter"
require_relative "blazer/adapters/neo4j_adapter"
require_relative "blazer/adapters/opensearch_adapter"
require_relative "blazer/adapters/presto_adapter"
Expand Down
1 change: 0 additions & 1 deletion lib/blazer/adapters.rb
Expand Up @@ -7,7 +7,6 @@
Blazer.register_adapter "hive", Blazer::Adapters::HiveAdapter
Blazer.register_adapter "ignite", Blazer::Adapters::IgniteAdapter
Blazer.register_adapter "influxdb", Blazer::Adapters::InfluxdbAdapter
Blazer.register_adapter "mongodb", Blazer::Adapters::MongodbAdapter
Blazer.register_adapter "neo4j", Blazer::Adapters::Neo4jAdapter
Blazer.register_adapter "opensearch", Blazer::Adapters::OpensearchAdapter
Blazer.register_adapter "presto", Blazer::Adapters::PrestoAdapter
Expand Down
43 changes: 0 additions & 43 deletions lib/blazer/adapters/mongodb_adapter.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/blazer/data_source.rb
Expand Up @@ -256,7 +256,7 @@ def run_statement_helper(statement, comment, options)
def detect_adapter
scheme = settings["url"].to_s.split("://").first
case scheme
when "mongodb", "presto", "cassandra", "ignite"
when "presto", "cassandra", "ignite"
scheme
else
"sql"
Expand Down
41 changes: 0 additions & 41 deletions test/adapters/mongodb_test.rb

This file was deleted.

3 changes: 0 additions & 3 deletions test/support/adapters.yml
Expand Up @@ -34,9 +34,6 @@ data_sources:
adapter: influxdb
url: http://localhost:8086/blazer_test

mongodb:
url: mongodb://localhost:27017/blazer_test

mysql:
url: mysql2://localhost:3306/blazer_test # ?prepared_statements=true

Expand Down

0 comments on commit 0c8989c

Please sign in to comment.