-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Generate db files during hanami new #180
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
bef0355
Add without hanami-db test context
cllns a911eb1
Add hanami-db to Gemfile, unless --skip-db is present
cllns e079ad0
Add generated app/repo.rb file to new project
cllns 47c574d
Add generated app/db/relation.rb file
cllns 6b56556
Add generated app/db/struct.rb file
cllns cab64e2
Add folders with .keep files for app/structs and app/repos
cllns 37f487a
Add .keep file to config/db/migrate, to create that folder and its pa…
cllns 03c340d
Add support for postgres, including pg gem
cllns ceeafaf
Add support for mysql databases
cllns b162ace
Prevent using --skip-db with --database
cllns 5a702fa
Support common other names for the databases
cllns 48c8fa0
Add more examples, simplify database pattern matching
cllns 566379b
Remove kwargs
cllns fe6fc88
Add AbcSize to enable
cllns 156c3a0
Remove FIXME, irrelevant
cllns f71c774
Remove deps, since it's not necessary
cllns 56c0166
Simplify test
cllns 03c2b93
Merge remote-tracking branch 'origin/main' into generate-db-files-dur…
cllns 187d0ff
Fix specs
cllns e4142d0
x.x.x => 2.2.0
cllns a0bdcb5
Make examples less verbose
cllns bfaea68
Ignore .env*.local
cllns fad7333
Add ROM transaction helper into base operation
cllns f6d116c
Add comment to .env
cllns 6a6d04f
Put base Repo in DB namespace
cllns File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This is checked into source control, so put sensitive values into `.env.local` | ||
<%- if generate_db? -%> | ||
DATABASE_URL=<%= database_url %> | ||
<%- end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.env | ||
.env*.local | ||
log/* | ||
<%- if generate_assets? -%> | ||
public/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
cllns marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
require "hanami/db/relation" | ||
|
||
module <%= camelized_app_name %> | ||
module DB | ||
class Relation < Hanami::DB::Relation | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
cllns marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
require "hanami/db/repo" | ||
|
||
module <%= camelized_app_name %> | ||
module DB | ||
class Repo < Hanami::DB::Repo | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
require "hanami/db/struct" | ||
|
||
module <%= camelized_app_name %> | ||
module DB | ||
class Struct < Hanami::DB::Struct | ||
end | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for thinking to include this! ❤️
This is definitely good to go in now. We want these operations to support DB transactions natively.
Seeing this inspired me to create an issue to help us eliminate this line of boilerplate before 2.2 final: hanami/hanami#1437