flaarum

package module
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2020 License: MIT Imports: 11 Imported by: 0

README

flaarum

Flaarum Logo

GoDoc

A database that enforces structures and features its own query language.

Why a new database.

  1. Every data stored in this database is automatically indexed unless it is large.

  2. Table Expansion (a more comfortable form of joins)

  3. Can make any changes to any table's structure even though you have data in the table.

Regular Features

  1. Supports its own query language.

Technologies Used.

  • Golang
  • Ubuntu
  • HTTPS
  • JSON

Documentation

The tutorial pages is located at pandolee.com.

API documentation can be found on godoc

Install

  1. Install from snapstore using sudo snap install flaarum

  2. Start the project with the command sudo snap start flaarum.store

  3. You don't need a key to connect with the database when not in production.

Production Setup
  1. Edit the config file found in /var/snap/flaarum/current/flaarum.json and set in_production to true

  2. Mount the persistent disk in the path /var/snap/flaarum/current/data

  3. Run sudo flaarum.mkpass to get the key that would be supplied in any database request.

  4. Use the key when creating flaarum.Client

CLI

You can use the cli flaarum.cli to administer the database from the terminal.

Run it with help flaarum.cli help to view available options.

License

Released with the MIT License

Documentation

Overview

this package 'flaarum' is the golang library for communicating with the flaarum server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RightDateFormat

func RightDateFormat(d time.Time) string

Converts a time.Time to the date format expected in flaarum

func RightDateTimeFormat

func RightDateTimeFormat(d time.Time) string

Converts a time.Time to the datetime format expected in flaarum

Types

type Client

type Client struct {
	Addr     string
	KeyStr   string
	ProjName string
}

func NewClient

func NewClient(addr, keyStr, projName string) Client

func (Client) CountRows

func (cl Client) CountRows(stmt string) (int64, error)

func (*Client) CreateProject

func (cl *Client) CreateProject(projName string) error

func (*Client) CreateTable

func (cl *Client) CreateTable(stmt string) error

func (Client) DeleteFields

func (cl Client) DeleteFields(stmt string, toDeleteFields []string) error

func (*Client) DeleteProject

func (cl *Client) DeleteProject(projName string) error

func (Client) DeleteRows

func (cl Client) DeleteRows(stmt string) error

func (*Client) DeleteTable

func (cl *Client) DeleteTable(tableName string) error

func (*Client) EmptyTable

func (cl *Client) EmptyTable(tableName string) error

func (*Client) GetCurrentTableStructureParsed

func (cl *Client) GetCurrentTableStructureParsed(tableName string) (flaarum_shared.TableStruct, error)

func (*Client) GetCurrentTableVersionNum

func (cl *Client) GetCurrentTableVersionNum(tableName string) (int64, error)

func (*Client) GetTableStructure

func (cl *Client) GetTableStructure(tableName string, versionNum int64) (string, error)

func (*Client) GetTableStructureParsed

func (cl *Client) GetTableStructureParsed(tableName string, versionNum int64) (flaarum_shared.TableStruct, error)

func (*Client) InsertRowAny

func (cl *Client) InsertRowAny(tableName string, toInsert map[string]interface{}) (string, error)

InsertRowStr inserts a row into a table. It expects the toInsert to be of type map[string]interface{}.

func (*Client) InsertRowStr

func (cl *Client) InsertRowStr(tableName string, toInsert map[string]string) (string, error)

InsertRowStr inserts a row into a table. It expects the input to be of type map[string]string. It returns a string which is parsable to an int64 for proper tables. For 'logs' tables it returns a string which is not parsable to int64

func (*Client) ListProjects

func (cl *Client) ListProjects() ([]string, error)

func (Client) ListTables

func (cl Client) ListTables() ([]string, error)

func (*Client) ParseRow

func (cl *Client) ParseRow(rowStr map[string]string, tableStruct flaarum_shared.TableStruct) (map[string]interface{}, error)

ParseRow given a TableStruct would convert a map of strings to a map of interfaces.

func (*Client) Ping

func (cl *Client) Ping() error

func (*Client) RenameProject

func (cl *Client) RenameProject(projName, newProjName string) error

func (*Client) RenameTable

func (cl *Client) RenameTable(tableName, newTableName string) error

func (*Client) Search

func (cl *Client) Search(stmt string) (*[]map[string]interface{}, error)

func (Client) SearchForOne

func (cl Client) SearchForOne(stmt string) (*map[string]interface{}, error)

func (Client) SumRows

func (cl Client) SumRows(stmt, toSumField string) (interface{}, error)

Sums the fields of a row and returns int64 if it is an int field or float64 if it a float field.

func (Client) UpdateRowsAny

func (cl Client) UpdateRowsAny(stmt string, updateData map[string]interface{}) error

func (Client) UpdateRowsStr

func (cl Client) UpdateRowsStr(stmt string, updateDataStr map[string]string) error

func (*Client) UpdateTableStructure

func (cl *Client) UpdateTableStructure(stmt string) error

Directories

Path Synopsis
This package contains functions shared by the parts of this project
This package contains functions shared by the parts of this project

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL