Giter VIP home page Giter VIP logo

unqlite-crud's Introduction

Go Report

unqlite-crud

Golang Unqlite

unqlite-crud is a golang example on how to use binder add, update, query and delete data in UnQLite. The UnQLite binder for golang used in this project is svkior/unqlitego .

What's UnQLite

UnQLite is a in-process software library which implements a self-contained, serverless, zero-configuration, transactional NoSQL database engine.

Get UnQLite

Docker

If you are familar with Docker, I recommend you to run unqlite-crud in Docker container, it will save a lot effort and time comparing to building UnQLite from source codes. Docker image zyfdedh/unqlite is available on Docker Hub. Pull it by

docker pull zyfdedh/unqlite

Nevermind, the image tagged latest(based on alpine) is as small as 5.41MB. Dockerfile is also opensourced on github zyfdegh/dockerfile-unqlite

Build from source

You can build UnQLite from scratch. UnQLite is written in C and you need a C compiler like GCC. Source codes is hosted on github symisc/unqlite

wget -c http://unqlite.org/db/unqlite-db-116.zip

unzip unqlite-db-116.zip

gcc -Wall -fPIC -c *.c

gcc -shared -Wl,-soname,libunqlite.so.1 -o libunqlite.so.1.0 *.o

sudo cp `pwd`/libunqlite.so.1.0 /usr/local/lib/
sudo cp `pwd`/unqlite.h /usr/local/include/
sudo ln -sf /usr/local/lib/libunqlite.so.1.0 /usr/local/lib/libunqlite.so.1
sudo ln -sf /usr/local/lib/libunqlite.so.1 /usr/local/lib/libunqlite.so

ldconfig /usr/local/lib/libunqlite.so

Run unqlite-crud in container

1.Clone

git clone https://github.com/zyfdegh/unqlite-crud.git

2.Build

./build.sh

3.Start a container

Similar to SQLite, UnQLite need not to start a daemon process, no port listenning, and no configurations. So you need to add command sh at last when starting a new container, otherwise the container will exit after created.

docker run -it zyfdedh/unqlite sh

4.Copy binary to container

Open a new console, first query unqlite container ID, like 16216318adc2

docker ps | grep unqlite

cd project home , and copy unqlite-crud to container

docker cp unqlite-crud 16216318adc2:/root/unqlite-crud

5.Run In the previous shell, run

cd ~ && ./unqlite-crud

Run unqlite-crud on host

If you choose to build unqlite from source and have already installed it on your machine.Run it directly.

1.Clone

git clone https://github.com/zyfdegh/unqlite-crud.git

2.Build

./build.sh

3.Run Run the binary under bin

./bin/unqlite-crud

Screenshot

unqlite-crud-screenshot

unqlite-crud's People

Contributors

zyfdegh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.