// initAuthDB opens auth.sqlite and creates the required tables
// if they don't exist
// It returns said database
initAuthDB opens auth.sqlite and creates the required tables
if they don't exist
It returns said database
// initAuthDB opens auth . sqlite and creates the required tables // if they don ' t exist // It returns said database
func initAuthDB() (*sql.DB, error) {
	os.Mkdir("storage", 0775)
	db, err := sql.Open("sqlite3", "storage/auth.sqlite")
	if err != nil {
		return nil, err
	}
	if db == nil {
		panic("DB is nil")
	}
	sql_table := `CREATE TABLE IF NOT EXISTS auth (
		name VARCHAR(32) NOT NULL,
		password VARCHAR(512) NOT NULL
	);
	CREATE TABLE IF NOT EXISTS privileges (
		name VARCHAR(32) NOT NULL,
		privileges VARCHAR(1024)
	);
	`
	_, err = db.Exec(sql_table)
	if err != nil {
		return nil, err
	}
	return db, nil
}
func initAuthDB ( ) ( * sql . DB , error ) { os . Mkdir ( " " , 0775 ) db , err := sql . Open ( " " , " " ) if err != nil { return nil , err } if db == nil { panic ( " " ) } sql_table := `CREATE TABLE IF NOT EXISTS auth (
		name VARCHAR(32) NOT NULL,
		password VARCHAR(512) NOT NULL
	);
	CREATE TABLE IF NOT EXISTS privileges (
		name VARCHAR(32) NOT NULL,
		privileges VARCHAR(1024)
	);
	` _ , err = db . Exec ( sql_table ) if err != nil { return nil , err } return db , nil }
initAuthDB opens auth.sqlite and creates the required tables
if they don't exist
It returns said database
initAuthDB opens auth . sqlite and creates the required tables if they don ' t exist It returns said database