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

Can't connect to database #52

Open
Dunckleosteus opened this issue Apr 27, 2023 · 2 comments
Open

Can't connect to database #52

Dunckleosteus opened this issue Apr 27, 2023 · 2 comments

Comments

@Dunckleosteus
Copy link

Hello I am a novice so this may seem obvious but when I try to connect to a local postgres database using the following code:

Repo.connect(
    adapter = Octo.Adapters.PostgreSQL,
    dbname = "postgis",
    user = "postgres"
)

I get the following error:

MethodError: no method matching getpass(::Base.DevNull, ::IOContext{Base.PipeEndpoint}, ::String)

Closest candidates are:

getpass(!Matched::Base.TTY, ::IO, ::AbstractString) at util.jl:261

getpass(::String)@util.jl:291
var"#Connection#17"(::Bool, ::Int64, ::Dict{String, String}, ::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::Type{LibPQ.Connection}, ::String)@connections.jl:309
Connection@connections.jl:265[inlined]
var"#db_connect#1"(::Base.Pairs{Symbol, String, Tuple{Symbol, Symbol}, NamedTuple{(:dbname, :user), Tuple{String, String}}}, ::typeof(Main.PostgreSQLLoader.db_connect))@PostgreSQL.jl:19
var"#invokelatest#2"(::Base.Pairs{Symbol, String, Tuple{Symbol, Symbol}, NamedTuple{(:dbname, :user), Tuple{String, String}}}, ::typeof(Base.invokelatest), ::Any)@essentials.jl:731
var"#connect#1"(::Module, ::Nothing, ::Bool, ::Base.Pairs{Symbol, String, Tuple{Symbol, Symbol}, NamedTuple{(:dbname, :user), Tuple{String, String}}}, ::typeof(Octo.Repo.connect))@Repo.jl:83
top-level scope@[Local: 1](http://localhost:1234/edit?id=c37d6530-e4d7-11ed-2220-d3f608429ebb#)[inlined]
```sql

All the dependencies should be installed.
@Dunckleosteus
Copy link
Author

Dunckleosteus commented Apr 27, 2023

Solved the problem, I forgot to specify the password. Here is the update code in case anyone makes the mistake:
Repo.connect(
adapter = Octo.Adapters.PostgreSQL,
dbname = "postgis",
user = "postgres",
password="password"
)

@wookay
Copy link
Owner

wookay commented Apr 27, 2023

good!

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

No branches or pull requests

2 participants