class Avram::Credentials
- Avram::Credentials
- Reference
- Object
Defined in:
avram/credentials.crConstructors
- .new(database : String, hostname : String | Nil = nil, username : String | Nil = nil, password : String | Nil = nil, port : Int32 | Nil = nil, query : String | Nil = nil)
-
.parse(connection_url : String) : Credentials
Parse a postgres connection string URL.
-
.void : Credentials
Used when you need to configure credentials, but no database connection is made.
Class Method Summary
-
.parse?(connection_url : String | Nil) : Credentials | Nil
Parse a postgres connection string URL.
Instance Method Summary
-
#connection_string : String
This is the full connection string used to connect to the PostgreSQL server.
-
#database : String
The name of the database you want to connect to
- #hostname : String | Nil
- #password : String | Nil
- #port : Int32 | Nil
- #query : String | Nil
- #url : String
-
#url_without_query_params : String
Returns the postgres connection string without any query params.
- #username : String | Nil
Instance methods inherited from class Object
blank_for_validates_required? : Bool
blank_for_validates_required?
Constructor Detail
Parse a postgres connection string URL. This may come from an environment variable.
Avram::Credentials.parse(ENV["DB_URL"])
Used when you need to configure credentials, but no database connection is made.
Class Method Detail
Parse a postgres connection string URL. This may come from an
environment variable.
Returns nil
if no connection_url
is provided.
Avram::Credentials.parse?(ENV["DB_URL"]?)
Instance Method Detail
This is the full connection string used to connect to the PostgreSQL server.
Returns the postgres connection string without any query params.