Skip to content

Commit

Permalink
add to devcontainer sqlite extension
Browse files Browse the repository at this point in the history
fix instruction in readme file

download the new zip codes database

add to rake task, the loadev task, to load locally the db
  • Loading branch information
dvlex committed Apr 23, 2024
1 parent cea2e45 commit 2b358a7
Show file tree
Hide file tree
Showing 7 changed files with 167,355 additions and 12,715 deletions.
22 changes: 2 additions & 20 deletions .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,15 @@
// An array of extension IDs that specify the extensions to install inside the
// container when you first attach to it.
"extensions": [
// Integrates ESLint into VS Code:
"dbaeumer.vscode-eslint",

// Provides enhanced Ruby language and debugging support for Visual Studio
// Code:
"rebornix.ruby",

// execute rubocop for current Ruby code.
"misogi.ruby-rubocop",

// A language server that provides intellisense, code completion, and inline
// documentation for Ruby:
"castwide.solargraph",

// Search modules, class and methods in ruby files using vscode go to symbol:
"miguel-savignano.ruby-symbols",

// Git Lens:
"eamodio.gitlens",

// Github Pull Requests and Issues:
"github.vscode-pull-request-github",

// Remotely browse and edit any GitHub repository:
"github.remotehub",

// GitHub Copilot:
"github.copilot"
"github.copilot",
"qwtel.sqlite-viewer"
]
}
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ GEM
parallel (1.21.0)
parser (3.1.0.0)
ast (~> 2.4.1)
public_suffix (5.0.5)
puma (4.3.12)
nio4r (~> 2.0)
racc (1.6.0)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ $ rails db:migrate
5. Next you should populate the database:
```bash
$ rails db:seed
$ rake data:load
```
This operation will take some time, due to the number of records. Rake data load will load the data from the csv files into the database, like seed does. Also, it will create the indexes for the database.
Expand Down
31,835 changes: 19,142 additions & 12,693 deletions lib/sepomex_db.csv
100755 → 100644

Large diffs are not rendered by default.

148,201 changes: 148,201 additions & 0 deletions lib/sepomex_db.csv.old

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions lib/tasks/data.rake
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ namespace :data do
load_db.perform!
end
end

task loadev: %i[environment] do
if Municipality.count.zero?
load_db = LoadCsvToDatabase.new
load_db.on_load_progress { |message, _data| print_flush message }
load_db.perform!
end
end
end
2 changes: 1 addition & 1 deletion tmp/pids/server.pid
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11733
3387

0 comments on commit 2b358a7

Please sign in to comment.