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
Doesn't compile on 0.24.2 #83
Comments
Hi @azah that cast wont work becuase the intention is to return a specific tuple type, not just Type. Probably there is an issue in the code you are not sharing yet. |
I'm using micrate, which as far as I can tell has this code: def self.get_versions_last_first_order(db)
db.query_all "SELECT version_id, is_applied from micrate_db_version ORDER BY id DESC", as: {Int64, Bool}
end
|
An expanded error trace:
|
# micrate.cr
def query_migration_status(migration, db)
db.query_all "SELECT tstamp, is_applied FROM micrate_db_version WHERE version_id=$1 ORDER BY tstamp DESC LIMIT 1", migration.version, as: {Time, Bool}
end
# lib/db/src/db/query_methods.cr
def query_all(query, *args, as types : Tuple)
query_all(query, *args) do |rs|
rs.read(*types)
end
end
# lib/db/src/db/result_set.cr
def read(*types : Class)
internal_read(*types)
end
private def internal_read(*types : *T) forall T
{% begin %}
Tuple.new(
{% for type in T %}
read({{type.instance}}),
{% end %}
)
{% end %}
end |
@andrewzah I assume we can close this one? |
Error:
crystal version:
edit: expanded error trace:
The text was updated successfully, but these errors were encountered: