memsql

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

README

MemSQL

MemSQL is a simple in-memory SQL database built in Go.

Features:

  • Support for creating tables with custom schemas
  • Support for inserting rows into tables
  • Support for querying data from tables using SQL syntax
Installation

To install MemSQL, first make sure you have Go installed on your system. Then run the following command:

go get github.com/hyperioxx/memsql

This will install MemSQL into your $GOPATH.

Usage

To start a MemSQL server, run the following command:

memsql-server

This will start the server on the default port (8080) and with an empty database.

To connect to the server using a client, run the following command:

memsql

This will start the command-line interface for the MemSQL client.

License

MemSQL is licensed under the GNU v2 license. See the LICENSE file for more information.

Contributing

If you'd like to contribute to MemSQL, please fork the repository and create a pull request.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conn net.Conn, server *Server) *Client

func (*Client) Handle

func (c *Client) Handle()

type Column

type Column struct {
	Name string
	Kind string
}

type Database

type Database struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase() *Database

func (*Database) CreateTable

func (db *Database) CreateTable(name string, schema []*Column) error

func (*Database) Execute

func (db *Database) Execute(query string) ([]*Row, error)

func (*Database) InsertRow

func (db *Database) InsertRow(tableName string, values map[string]interface{}) error

func (*Database) SelectRows

func (db *Database) SelectRows(tableName string, columns []string, where string) ([]*Row, error)

type Row

type Row struct {
	// contains filtered or unexported fields
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

func (*Server) CreateDatabase

func (s *Server) CreateDatabase(name string) error

func (*Server) DeleteDatabase

func (s *Server) DeleteDatabase(name string) error

func (*Server) GetDatabase

func (s *Server) GetDatabase(name string) (*Database, error)

func (*Server) Listen

func (s *Server) Listen(port int) error

type Table

type Table struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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