class PgConn::RoleMethods
def create(rolename, superuser: false, create_database: false, can_login: false, create_role: false)
def create(rolename, superuser: false, create_database: false, can_login: false, create_role: false) user_decl = "create role \"#{rolename}\"" superuser_decl = superuser ? "superuser" : "nosuperuser" create_database_decl = create_database ? "createdb" : "nocreatedb" can_login_decl = can_login ? "login" : "nologin" create_role_decl = create_role ? "createrole" : "nocreaterole" stmt = [user_decl, superuser_decl, can_login_decl, create_role_decl].compact.join(" ") conn.exec stmt end