-
Notifications
You must be signed in to change notification settings - Fork 28
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
Update TypeMapper.scala added support for Float data type #32
Conversation
@rmorales-iaa seems like |
I have completed the definitions for the 'Float' data type, and it should compile now |
Right now, I am importing GAIA_DR_3 (https://gea.esac.esa.int/archive/documentation/GDR3/Gaia_archive/chap_datamodel/sec_dm_main_source_catalogue/ssec_dm_gaia_source.html) into PostgreSQL 16.3 with the modified version that supports Floats. Inspecting the columns created in the database:
This corresponds to the definition in scalasql: case class SourceMinimal[T[_]]( Here are the repositories with the source code for the import: |
@rmorales-iaa can you run the autoformatting and autofixes according to https://github.com/com-lihaoyi/scalasql/blob/main/docs/developer.md#code-formatting-and-auto-fixes |
Uhmm, the patch works for table insertion but not for table selection. "could not find implicit value for parameter e: scalasql.Queryable.Row[scalasql.core.Expr[Float],Float] If I find a solution, I will update this pull request. |
False alarm. I didn't properly update the dependencies to the new patch. My entire project with scalasql compiles now |
I've some errors runnig
scalasql.ExampleTests.postgres 10ms Tests: 680, Passed: 677, Failed: 3 |
Regarding your last issue,
Do you have docker installed on your system and configured to use for the current user? |
…ating tutorial and referencesd
Right, right, I didn't see the precondition at the beginning of the page. As you'll see, I'm new to using 'mill'. After switching the repository to a computer with Docker, all tests were verified: Tests: 1675, Passed: 1675, Failed: 0" |
scalasql/src/dialects/Dialect.scala
Outdated
class FloatType extends TypeMapper[Float] { | ||
def jdbcType = JDBCType.FLOAT | ||
def get(r: ResultSet, idx: Int) = r.getFloat(idx) | ||
def put(r: PreparedStatement, idx: Int, v: Float) = r.setDouble(idx, v) |
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.
@rmorales-iaa should this be setFloat
, for symmetry with the getFloat
above?
…some 'from' for basic data types
"You're right, it should be 'r.setFloat(idx, v)' instead of 'r.setDouble(idx, v)'. |
Looks good to me, @rmorales-iaa if you're happy with it I'll merge and cut a release |
Nice!, please go ahead |
No description provided.