flaarum

package module
Version: v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: MIT Imports: 11 Imported by: 4

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. Text fields are indexed with full text search indexes.

  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.

  2. Full text Search.

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. Start the text indexer with the command sudo snap start flaarum.tindexer

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

Basic Production Setup (Google Cloud)
  1. Create a launch file with flaarum.lgcp initb and edit it to your specifications

  2. Create a service account and store the downloaded json in your flaarum folder (gotten from flaarum.cli pwd)

  3. If you have a project that you've not launched an instance in before. Enable compute api with this command gcloud services enable compute.googleapis.com --project {project}.Remember to replace the project with you project name.

  4. Launch the service with flaarum.lgcp lb launchfile serviceaccountfile where launchfile is the name of the file created in step 1 excluding the path and serviceaccountfile is the json in step 2 excluding the path.

  5. SSH into the server and run flaarum.prod r to get your key string. Needed in your program to connect to your flaarum server.

AutoScaling Production Setup (Google Cloud)
  1. Create a launch file with flaarum.lgcp initas and edit it to your specifications

  2. Create a service account and store the downloaded json in your flaarum folder (gotten from flaarum.cli pwd)

  3. If you have a project that you've not launched an instance in before. Enable compute api with this command gcloud services enable compute.googleapis.com --project {project}.Remember to replace the project with you project name.

  4. Launch the service with flaarum.lgcp las launchfile serviceaccountfile where launchfile is the name of the file created in step 1 excluding the path and serviceaccountfile is the json in step 2 excluding the path.

  5. SSH into the server (not the control server) and run flaarum.prod r to get your key string. Needed in your program to connect to your flaarum server.

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(ip, keyStr, projName string) Client

func (Client) AllRowsCount

func (cl Client) AllRowsCount(tableName string) (int64, error)

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
cli provides a terminal interface to the flaarum server.
cli provides a terminal interface to the flaarum server.
This package contains functions shared by the programs of this project.
This package contains functions shared by the programs of this project.
gcpasr is the autoscaling resizer for Google Cloud projects.
gcpasr is the autoscaling resizer for Google Cloud projects.
gcprb repeatedly runs 'flaarum.inout' and stores the output file to google cloud storage.
gcprb repeatedly runs 'flaarum.inout' and stores the output file to google cloud storage.
inout creates compressed backup files and can restore a flaarum project from the said files.
inout creates compressed backup files and can restore a flaarum project from the said files.
lgcp is the launcher program for Google Cloud platform
lgcp is the launcher program for Google Cloud platform
prod provides the commands which helps in making a flaarum server production ready.
prod provides the commands which helps in making a flaarum server production ready.
statsr repeatedly stores the CPU and RAM usage of a server.
statsr repeatedly stores the CPU and RAM usage of a server.
This is the server that accepts and stores data from clients.
This is the server that accepts and stores data from clients.
tindexer is a program that creates indexes for tables which contains text fields.
tindexer is a program that creates indexes for tables which contains text fields.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto