Skip to content
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

Experimental/json serializable columns #695

Merged
merged 8 commits into from
Jul 18, 2021
Prev Previous commit
Next Next commit
use separate branch with json changes and we no longer need any patches
jwoertink committed Jul 5, 2021
commit 29aec80415f7773cfd9fda12b3af8a14e658487e
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ dependencies:
github: luckyframework/lucky_task
version: ~> 0.1.0
pg:
github: will/crystal-pg
version: ~> 0.23.0
github: matthewmcgarvey/crystal-pg
branch: read-json-columns
habitat:
github: luckyframework/habitat
version: ~> 0.4.7
20 changes: 0 additions & 20 deletions src/avram/charms/json_decoder_extension.cr

This file was deleted.

3 changes: 1 addition & 2 deletions src/avram/model.cr
Original file line number Diff line number Diff line change
@@ -237,9 +237,8 @@ abstract class Avram::Model
{% else %}
{% value = nil %}
{% end %}
{% serialized = is_serialized || data_type == "JSON::Any".id %}

{% COLUMNS << {name: type_declaration.var, type: data_type, nilable: nilable.id, autogenerated: autogenerated, value: value, serialized: serialized} %}
{% COLUMNS << {name: type_declaration.var, type: data_type, nilable: nilable.id, autogenerated: autogenerated, value: value, serialized: is_serialized} %}
end

macro setup_column_info_methods(columns, *args, **named_args)
1 change: 0 additions & 1 deletion src/avram/query_builder.cr
Original file line number Diff line number Diff line change
@@ -243,7 +243,6 @@ class Avram::QueryBuilder
@selections = selection
.map { |column| "#{@table}.#{column}" }
.join(", ")

self
end