forked from anykeyh/clear
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yacine Petitprez
committed
Jul 8, 2018
1 parent
3979d7b
commit 474d7d1
Showing
7 changed files
with
85 additions
and
15 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
require "db" | ||
|
||
module Clear::SQL::Query::Execute | ||
def execute(connection_name : String = "default") | ||
# Execute an operation without asking for return | ||
# If an optional `connection_name` parameter is given, this will | ||
# override the connection used. | ||
# | ||
# ```crystal | ||
# # Apply a method from an extension on multiple database | ||
# | ||
# %(default secondary).each do |cnx| | ||
# Clear::SQL.select("pg_shards('xxx')").execute(cnx) | ||
# end | ||
# ``` | ||
def execute(connection_name : String? = nil) | ||
connection_name ||= self.connection_name | ||
Clear::SQL.execute(connection_name, to_sql) | ||
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
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