-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
528 changed files
with
27,729 additions
and
12,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Folder-specific settings | ||
// | ||
// For a full list of overridable settings, and general information on folder-specific settings, | ||
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files | ||
{ | ||
"search": { | ||
"whole_word": false, | ||
"case_sensitive": false, | ||
"include_ignored": true, | ||
"regex": false | ||
}, | ||
"languages": { | ||
"SQL": { | ||
"remove_trailing_whitespace_on_save": false, | ||
"format_on_save": "off" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require "poncho" | ||
|
||
class StatBusConfig | ||
include Poncho | ||
|
||
property postgres_host : String | ||
property postgres_port : String | ||
property postgres_db : String | ||
property postgres_user : String | ||
property postgres_password : String | ||
|
||
def initialize(project_directory : Path, @verbose : Bool) | ||
@postgres_host = "127.0.0.1" | ||
@postgres_user = "postgres" | ||
env_path = project_directory.join(".env") | ||
if @verbose | ||
puts "Looking for .env at: #{env_path}" | ||
puts "Current directory: #{Dir.current}" | ||
puts "Project directory: #{project_directory}" | ||
end | ||
|
||
if File.exists?(env_path) | ||
puts "Found .env file" if @verbose | ||
env_config = Poncho.from_file(env_path.to_s) | ||
else | ||
raise "Could not find .env file at #{env_path}" | ||
end | ||
@postgres_port = env_config["DB_PUBLIC_LOCALHOST_PORT"]? || raise "Missing DB_PUBLIC_LOCALHOST_PORT in .env" | ||
@postgres_db = env_config["POSTGRES_DB"]? || raise "Missing POSTGRES_DB in .env" | ||
@postgres_password = env_config["POSTGRES_PASSWORD"]? || raise "Missing POSTGRES_PASSWORD in .env" | ||
end | ||
|
||
def connection_string : String | ||
"postgres://#{postgres_user}:#{postgres_password}@#{postgres_host}:#{postgres_port}/#{postgres_db}" | ||
end | ||
end |
Oops, something went wrong.