sqldelight icon indicating copy to clipboard operation
sqldelight copied to clipboard

Postgres: Support Postgis Point type and related functions.

Open vanniktech opened this issue 9 months ago • 6 comments

Still have a bunch of questions and this is not done yet. However, I did manage to publish the postgres dialect into my maven local and use it already. Since my query filtering is dynamic, I currently only need the Geometry Type since I construct the sql to query myself.


Is it correct that I when I make a change to the dialect, I have to ./gradlew publishToMavenLocal? This moves it into the build directory of the repository. So like in sqldelight/dialects/postgresql, I execute ./gradlew publishToMavenLocal and then I can run the integration tests?

How do I run the integration tests though? If I'm in the sqldelight/sqldelight-gradle-plugin/src/test/integration-postgresql directory and I try to run the tests using ./gradlew test, I'm getting:

PostgreSqlTest > testBooleans FAILED
    java.lang.IllegalStateException: Previous attempts to find a Docker environment failed. Will not retry. Please see logs and check configuration
        at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:232)
        at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:154)
        at org.testcontainers.DockerClientFactory.dockerHostIpAddress(DockerClientFactory.java:344)
        at org.testcontainers.containers.ContainerState.getHost(ContainerState.java:64)
        at org.testcontainers.containers.PostgreSQLContainer.getJdbcUrl(PostgreSQLContainer.java:100)
        at org.testcontainers.containers.JdbcDatabaseContainer.constructUrlForConnection(JdbcDatabaseContainer.java:309)
        at org.testcontainers.containers.JdbcDatabaseContainer.createConnection(JdbcDatabaseContainer.java:269)
        at org.testcontainers.jdbc.ContainerDatabaseDriver.connect(ContainerDatabaseDriver.java:140)
        at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:683)
        at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:253)
        at app.cash.sqldelight.postgresql.integration.PostgreSqlTest.<init>(PostgreSqlTest.kt:24)

What docker do I need to start? Could I also just point it to a local postgres installation on my Mac?

vanniktech avatar Jan 04 '25 09:01 vanniktech