Closed rmorales-iaa closed 1 month ago
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:
ra: float8
ra_error: float4
This corresponds to the definition in scalasql:
case class SourceMinimal[T[_]]( ... , ra: T[Double] , ra_error: T[Float] ... )
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] object gaia_source_minimal extends Table[SourceMinimal]() "
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
./mill -i -w __.fix + mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources + "scalasql[2.13.12].test" + generateTutorial + generateReference
scalasql.ExampleTests.postgres 10ms
java.lang.NoClassDefFoundError: Could not initialize class scalasql.example.PostgresExample$
scalasql.ExampleTests$.$anonfun$tests$2(ExampleTests.scala:9)
java.lang.ExceptionInInitializerError: Exception java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration [in thread "main"]
org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$7(DockerClientProviderStrategy.java:277)
java.util.Optional.orElseThrow(Optional.java:408)
org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:268)
org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:152)
org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:193)
org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:106)
com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109)
org.testcontainers.containers.GenericContainer.start(GenericContainer.java:333)
scalasql.example.PostgresExample$.postgres$lzycompute(PostgresExample.scala:22)
scalasql.example.PostgresExample$.postgres(PostgresExample.scala:19)
scalasql.example.PostgresExample$.
Tests: 680, Passed: 677, Failed: 3 1 targets failed scalasql[2.13.12].test.test 95 tests failed: scalasql.postgres.DbApiTests scalasql.postgres.DbApiTests. scalasql.postgres.TransactionTests scalasql.postgres.TransactionTests. scalasql.postgres.SelectTests scalasql.postgres.SelectTests. scalasql.postgres.JoinTests scalasql.postgres.JoinTests. scalasql.postgres.FlatJoinTests scalasql.postgres.FlatJoinTests. and 90 more ...
Regarding your last issue,
IllegalStateException: Could not find a valid Docker environment.
Do you have docker installed on your system and configured to use for the current user?
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"
"You're right, it should be 'r.setFloat(idx, v)' instead of 'r.setDouble(idx, v)'. I have already made the correction, and I have also added some 'implicit def from(x: ): Expr[] = Expr(x)' that were missing for basic data types in the same file 'Dialect.java'. I ran the tests and code formatting with mill, and I pushed it to the new pull request in the repository."
Looks good to me, @rmorales-iaa if you're happy with it I'll merge and cut a release
Nice!, please go ahead
@rmorales-iaa seems like
FloatType
does not compile, might need some more tweaks