-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The default value will now output with the correct color
- Loading branch information
Showing
9 changed files
with
100 additions
and
100 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class TableInspector::Presenter::Mysql2 < TableInspector::Presenter | ||
def extract_meta_without_highlight(column) | ||
column.as_json.merge(column.sql_type_metadata.as_json).slice(*ordered_keys).tap do |column_data| | ||
column_data["default"] = case column_data["type"] | ||
when "string" | ||
column_data["default"]&.inspect | ||
when "boolean" | ||
{ "1" => true, "0" => false }[column_data["default"]] | ||
else | ||
column_data["default"] | ||
end | ||
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,15 @@ | ||
|
||
class TableInspector::Presenter::Postgresql < TableInspector::Presenter | ||
def extract_meta_without_highlight(column) | ||
column.as_json.merge(column.sql_type_metadata.as_json).slice(*ordered_keys).tap do |column_data| | ||
column_data["default"] = case column_data["type"] | ||
when "string" | ||
column_data["default"]&.inspect | ||
when "boolean" | ||
{ "true" => true, "false" => false }[column_data["default"]] | ||
else | ||
column_data["default"] | ||
end | ||
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,15 @@ | ||
class TableInspector::Presenter::Sqlite3 < TableInspector::Presenter | ||
|
||
def extract_meta_without_highlight(column) | ||
column.as_json.merge(column.sql_type_metadata.as_json).slice(*ordered_keys).tap do |column_data| | ||
column_data["default"] = case column_data["type"] | ||
when "string" | ||
column_data["default"]&.inspect | ||
when "boolean" | ||
{ "1" => true, "0" => false }[column_data["default"]] | ||
else | ||
column_data["default"] | ||
end | ||
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
This file was deleted.
Oops, something went wrong.