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

add minimal support for mysql unix domain sockets. #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mknoszlig
Copy link

This is a minimal request for comments implementation for #53

i've tested so far using the following code (using a vanilla mysql install):

(ns pod.babashka.test
  (:require [next.jdbc :as jdbc])
  (:gen-class))

(def uri "jdbc:mysql:///mysql?user=root&socketFactory=pod.babashka.mysql.UnixSocketFactory")
(defn get-connection [db-spec]
  (jdbc/get-connection {:jdbcUrl db-spec
                        "pod.babashka.mysql.file" "/tmp/mysql.sock"}))

(defn -main []
  (try
    (with-open [c (get-connection uri)]
      (println (jdbc/execute! c ["select version();"])))
    (catch Throwable t
      (.printStackTrace t))))
> POD_DB_TYPE=mysql lein do compile, clean, with-profiles +feature/mysql run -m pod.babashka.test
Compiling 2 source files to /Users/mknoszlig/work/babashka-sql-pods/target/classes
connecting to socket:/tmp/mysql.sock
class: Socket[addr=null,port=0,localport=0]
[{:version() 8.0.28}]

Is there anything I need to consider for the native build (aside from using the correct graalvm version)? Will the java classes get picked up correctly?

@mknoszlig
Copy link
Author

Note: build uses the older graalvm version

curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.3.0/graalvm-ce-java11-linux-amd64-21.3.0.tar.gz

@borkdude
Copy link
Collaborator

Don't know. You can try this locally first with GraalVM 17?

@borkdude
Copy link
Collaborator

Also, upgrade to 22.0.0.2 while you're at it :)

@mknoszlig
Copy link
Author

mknoszlig commented Mar 15, 2022

classes appear to get picked up correctly, I'm still tracking a NPE that I'm just seeing running on GraalVM but not when running on JVM as described above.
will also update generate_circleci.clj to 22.0.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants