Comments (10)
I cannot reproduce this. I would need more information. Did you modify/change your local copy of the repository?
from dburl.
No, I have not changed my local copy. go describe --always --dirty
would have reported this (--dirty
flag).
from dburl.
@dolmen I would need more information then. Are you running an old version of Go or some such? Please provide information on the platform / go version / etc. you're using. Otherwise, I have nothing available to me to reproduce this behavior.
from dburl.
go version go1.10.3 darwin/amd64
from dburl.
I've gone back in history to find where the breakage is starting (git checkout HEAD~1 && go test -run TestParse
).
First commit where go test -run TestParse
fails is c1aceeb.
from dburl.
I notice that resolving Postgres URL calls os.Stat
(in func mode
in util.go
).
I don't have Postgres installed on my machine, so /var/run/postgresql
doesn't exist. This is the difference.
I'm updating the title. Please reopen.
from dburl.
It is very bad that a function called Parse
has different results depending on the filesystem state.
Worse: this behaviour is not documented.
from dburl.
@dolmen I appreciate your interest in this project, but this is not an actual issue. The unit tests work properly to test what they were designed to test. If you'd like to submit a PR selectively disabling these unit tests for use on environments where PostgreSQL is not installed, I'd consider merging that.
from dburl.
Because of this issue, the testsuite doesn't work also on non-Unix environments (e.g. Windows).
from dburl.
@dolmen I've already stated that if you'd like to submit a PR selectively disabling this functionality (ie, for certain environments such as Windows), I'd be open to it. As it is, the reason this won't work on Windows, is because Windows (until very recently) has not supported Unix Domain Sockets. That said, the latest version of Windows 10 1603 does indeed support Unix Domain Sockets. As such, the correct thing to do here would be to:
- First fix Go to work with
AF_UNIX
on Windows - Submit a PR changing the path this is used against, selectively based on OS using Go's build tags
Also, it's worth noting that unit tests do not need to work on every platform. These unit tests work for all the testing environments they were designed for. If they are not working on your platform, that's because you're using a non-standard platform (Windows) for development.
I have no intention of rewriting unit tests to work on broken Windows environments. By and large the users / developers of Go, usql
, and dburl
are not using Windows systems. If you would like the unit tests to work on (in my opinion) the broken Windows platform, feel free to submit a PR. I'll gladly accept it assuming it is well written.
from dburl.
Related Issues (20)
- panic: runtime error: slice bounds out of range HOT 2
- Issue with MySQL URLs in go >= 1.12.8 HOT 1
- Feature Request: redis dsn HOT 2
- Support for New Relic integrations HOT 2
- Error parsing mysql DSN HOT 1
- Add support for arbitrary protocols HOT 2
- Support socket files in mysql mode HOT 4
- Modify the query parameters? HOT 6
- Special characters in password HOT 2
- Fails to parse passwords with '#' for mssql. HOT 9
- no documentation on v0.16.0 Gen return parameters
- duckdb support HOT 1
- Support for MSSQL named pipe (np:) and shared memory (lpc:) DSNs HOT 1
- Parse returns postgres scheme for file protocol when directory in path exists HOT 11
- couchbase error: n1ql: Connection failed Post HOT 9
- Plans for a CLI? HOT 1
- UNIX socket path should support URL encoding HOT 4
- Can't register scheme starting with "my" HOT 3
- Parse for {postgres,mysql}+unix schemes depend on filesystem state HOT 1
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 dburl.