sebastianwessel / surrealdb-client-generator

Tool which generates a typescript client for SurrealDB and zod schema of a given database
MIT License
77 stars 12 forks source link

Feature Request: Allow Override of Container Image Name for SurrealDB In Memory Container #60

Closed jascenc1 closed 3 months ago

jascenc1 commented 3 months ago

I’m using surql-gen (v2.6.0) in an environment where pulling images directly from Docker Hub is blocked due to a VPN/proxy. I have a SurrealDB image available in our Artifactory, but the tool tries to pull the latest image from Docker Hub.

Feature Request:

It would be really useful to have an option to override the default SurrealDB container image name, like how Helm charts allow for container overrides. This would let users specify a custom image from an internal registry (e.g., Artifactory), making the tool more flexible in different network setups where Docker Hub isn’t accessible, and images need to come from an internal registry.

Proposed Solution:

Add a config option in surql-gen to let users pull surrealdb:latest from an internal registry.

Example usage:

npx surql-gen -f schema.surql -o ./output --no-generate-client --container-registry myregistry.com/surrealdb/surrealdb:latest

That would update pass in the registry URL here.

Thanks for considering this! The tool has been super helpful, and this feature would make it even better for different environments.

hammo92 commented 3 months ago

Seems reasonable to me, should be a simple change. Any concerns @sebastianwessel?

sebastianwessel commented 3 months ago

no makes sense. maybe, a short look into testcontainer config might be good - don´t know out of my mind if there are other helpfully options

sebastianwessel commented 3 months ago

Released version 2.6.1, which includes the config option. Thanks @hammo92

jascenc1 commented 3 months ago

Note for Private Registry Users:

If you're using a private registry, you’ll need to configure Testcontainers to pull the Ryuk image from your internal registry. You can do this by creating a .testcontainers.properties file in your user directory (windows: e.g., C:/Users/YourUsername/.testcontainers.properties) with the following configuration:

ryuk.container.image = yourregistry.com/ryuk:0.3.3

This ensures Testcontainers pulls the Ryuk image from your registry, which is necessary for container cleanup.

See here for more details