Comments (2)
Really awesome to see you're building out features based on this library, I'm glad it's been useful.
We're unlikely to bundle such a long list of specific versions as the intended use-case for this library is really for integration testing, and as such we aim to keep the version selections as simple as possible, with the option to provide a custom string if needed.
That said, we've left the door open with the current strategy to put a wrapper around this library with the above and do all of that logic on the outside - which it looks like you may have done already?
We are actively looking at the remote fetch logic and seeing if this could be made into a middleware style function, but it's not something we are close to making a decision on yet.
If there are any other features you're after feel free to open an issue. All the best and good luck with the CLI!
from embedded-postgres.
Thanks I'll keep you in the loop for where it goes!
In the meantime, here's the Go logic to list supported versions:
import (
"encoding/xml"
"errors"
"fmt"
"io"
"log"
"net/http"
"os"
"path"
"time"
embeddedpostgres "github.com/fergusstrange/embedded-postgres"
cli "github.com/urfave/cli/v2"
)
type Metadata struct {
XMLName xml.Name `xml:"metadata"`
Text string `xml:",chardata"`
GroupId string `xml:"groupId"`
ArtifactId string `xml:"artifactId"`
Versioning struct {
Text string `xml:",chardata"`
Latest string `xml:"latest"`
Release string `xml:"release"`
Versions struct {
Text string `xml:",chardata"`
Version []string `xml:"version"`
} `xml:"versions"`
LastUpdated string `xml:"lastUpdated"`
} `xml:"versioning"`
}
func main() {
var metadata Metadata
{
resp, err := http.Get("https://repo1.maven.org/maven2/io/zonky/test/postgres/embedded-postgres-binaries-bom/maven-metadata.xml")
if err != nil {
panic(err)
}
defer func(Body io.ReadCloser) {
err := Body.Close()
if err != nil {
panic(err)
}
}(resp.Body)
body, err := io.ReadAll(resp.Body)
if err := xml.Unmarshal(body, &metadata); err != nil {
panic(err)
}
}
for _, version := range metadata.Versioning.Versions.Version {
fmt.Printf("\"%s\",\n", version)
}
}
from embedded-postgres.
Related Issues (20)
- Unexported field 'version' usage HOT 3
- Error when DataBase is Specified in Config HOT 1
- Expose an interface to retrieve binaries from non-network sources HOT 5
- twirp error internal: conn closed HOT 1
- Getting 'creating directory /Users/MyUser/.embedded-postgres-go/extracted/data ... initdb: error: could not create directory "/Users/MyUser/.embedded-postgres-go/extracted/data": File exists' when running tests that use embedded postgres in parallel HOT 1
- How to shutdown an existing PG instance? HOT 1
- Absolutely not concurrency-safe HOT 3
- CLI release for PostgreSQL version manager [embedding your project] HOT 1
- Process already running in port when test panics using embedded postgres HOT 6
- how to change r/w permission? HOT 7
- Metadata tables missing HOT 1
- Jar unzip fails when server does not set ContentLength HOT 1
- syntax error at or near "-" (SQLSTATE 42601) HOT 1
- Support for dynamic port allocation HOT 4
- postgres version 13.11 has multiple high CVEs: CVE-2023-39417, CVE-2023-5869, CVE-2024-0985 HOT 1
- unable to init database FATAL: could not create shared memory segment: No space left on device HOT 1
- [Bug]: Unable to write password file HOT 1
- Why erased RuntimePath directory? HOT 1
- Get error "unable to extract postgres archive: xz: data is truncated or corrupt" in GitLab pipeline. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embedded-postgres.