Skip to content

servers.postgres #

struct PostgresConfig #

struct PostgresConfig {
	pg_bin   string
	data_dir string
	log_file string
	port     int = 5432
}

struct Server #

struct Server {
	config PostgresConfig
}

fn (Server) start #

fn (server Server) start() !

Function to start the PostgreSQL server

fn (Server) stop #

fn (server Server) stop() !

Function to stop the PostgreSQL server

fn (Server) initdb #

fn (server Server) initdb() !

Function to initialize the PostgreSQL database

fn (Server) create_db #

fn (server Server) create_db(db_name string) !

Function to create a new database

fn (Server) create_user #

fn (server Server) create_user(username string, password string) !

Function to create a new user

fn (Server) grant_privileges #

fn (server Server) grant_privileges(db_name string, username string) !

Function to grant privileges to a user on a database