release 2.0: reids, postgres, python
|
@ -4,7 +4,9 @@
|
||||||
|
|
||||||
# Postgres workspace
|
# Postgres workspace
|
||||||
|
|
||||||
Collected toolset to work with PostgreSQL. Query, explore, manage, develop, test performance, import annd export data,
|
Collection of tools to interact with PostgreSQL.
|
||||||
|
|
||||||
|
Query, explore, manage, develop, test performance, import annd export data,
|
||||||
generate mock data, create backups, manage migrations, generate reports, schedule tasks.
|
generate mock data, create backups, manage migrations, generate reports, schedule tasks.
|
||||||
|
|
||||||
## Why this images
|
## Why this images
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
These tutorials demonstrates how to use Postgres workspace to explore and interact with Postgres.
|
These tutorials demonstrates how to use Postgres workspace to explore and interact with Postgres.
|
||||||
|
|
||||||
To start, open workspace UI [http://localhost:8020/](http://localhost:8020/) for quick access to all the tools.
|
To start, open Quickstart page [http://localhost:8020/](http://localhost:8020/) for quick access to all the tools.
|
||||||
Use terminal to execute commands from this tutorial.
|
Use terminal to execute commands from this tutorial.
|
||||||
|
|
||||||
## Postgres
|
## Postgres
|
||||||
|
|
|
@ -15,12 +15,8 @@ RUN pip install -r /home/abc/installed-python-packages/python-requirements.txt \
|
||||||
&& echo "------------------------------------------------------ graphviz" \
|
&& echo "------------------------------------------------------ graphviz" \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install -y graphviz \
|
&& apt-get install -y graphviz \
|
||||||
&& apt-get install -y python-pydot python-pydot-ng \
|
&& apt-get install -y python3-pydotplus \
|
||||||
&& echo "------------------------------------------------------ utils" \
|
&& echo "------------------------------------------------------ utils" \
|
||||||
&& rm -rf /home/abc/utils || true \
|
|
||||||
&& git clone https://github.com/bluxmit/alnoda-workspaces /tmp/alnoda-workspaces \
|
|
||||||
&& mv /tmp/alnoda-workspaces/utils /home/abc/ \
|
|
||||||
&& rm -rf /tmp/alnoda-workspaces \
|
|
||||||
&& echo "alias python-report='/home/abc/utils/python-report.sh'" >> /home/abc/.zshrc \
|
&& echo "alias python-report='/home/abc/utils/python-report.sh'" >> /home/abc/.zshrc \
|
||||||
&& chmod +x /home/abc/utils/python-report.sh && chown abc /home/abc/utils/python-report.sh \
|
&& chmod +x /home/abc/utils/python-report.sh && chown abc /home/abc/utils/python-report.sh \
|
||||||
&& echo "------------------------------------------------------ user" \
|
&& echo "------------------------------------------------------ user" \
|
||||||
|
|
|
@ -4,9 +4,8 @@
|
||||||
|
|
||||||
# Python workspace
|
# Python workspace
|
||||||
|
|
||||||
Dockerized Python development environment. Fully isolated inside a docker container.
|
Docker image for Python development environment. Includes Python, python tooling together with browser-based IDE, file browser,
|
||||||
Includes code editor, terminal, scheduler, filebrowser. As well as tools for linting,
|
static server, job scheduler.
|
||||||
testing, auto-documentation, performance and profiling.
|
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/python-wid-collage-sm.jpg" alt="Collage" width="750">
|
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/python-workspace/img/python-wid-collage-sm.jpg" alt="Collage" width="750">
|
||||||
|
@ -15,7 +14,7 @@ testing, auto-documentation, performance and profiling.
|
||||||
## Why this images
|
## Why this images
|
||||||
|
|
||||||
1. If you need isolated dev environment where you can code and install packages and apps without affecting the base operating system.
|
1. If you need isolated dev environment where you can code and install packages and apps without affecting the base operating system.
|
||||||
2. If you want self-hosted remote development environment.
|
2. If you need self-hosted remote development environment.
|
||||||
3. If you want to get started with Python fast.
|
3. If you want to get started with Python fast.
|
||||||
|
|
||||||
## Start
|
## Start
|
||||||
|
|
|
@ -39,7 +39,7 @@ You can install any extension from [open-vsx.org](https://open-vsx.org/) that ha
|
||||||
|
|
||||||
## Terminal
|
## Terminal
|
||||||
|
|
||||||
Open Tterminnal from the Quickstart page.
|
Open Terminnal from the Quickstart page.
|
||||||
|
|
||||||
<div align="center" style="font-style: italic;">
|
<div align="center" style="font-style: italic;">
|
||||||
Demo: Browser-based terminal
|
Demo: Browser-based terminal
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
ARG docker_registry=docker.io/alnoda
|
ARG docker_registry=docker.io/alnoda
|
||||||
ARG image_tag=18.04-1.0
|
ARG image_tag=2.0
|
||||||
|
|
||||||
## Images used:
|
## Images used:
|
||||||
ARG BUILD_IMAGE=node:12.18.3
|
ARG BUILD_IMAGE=node:12.18.3
|
||||||
|
|
|
@ -3,81 +3,62 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# Redis workspace
|
# Redis workspace
|
||||||
Docker image with Redis, Redis Commander and other Redis CLI tools. Can be used to manage cloud Redis deployments,
|
|
||||||
or as Redis docker image with batteries included for local development.
|
Docker image with Redis, Redis Commander and several CLI tools to interact with Redis.
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/redis-wid-collage.png" alt="Collage">
|
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/redis-wid-collage.png" alt="Collage" width="750">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
## Why this images
|
||||||
|
|
||||||
|
1. To directly interact with Redis inside your kubernetes cluster.
|
||||||
|
2. A better Redis docker image for local dev environment. You get Redis together with the toolset to work with it.
|
||||||
|
|
||||||
|
## Start
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run --name rwid-1 -d -p 8020-8035:8020-8035 alnoda/redis-workspace
|
docker run --name rwid-1 -d -p 8020-8035:8020-8035 alnoda/redis-workspace
|
||||||
```
|
```
|
||||||
|
|
||||||
open your browser on [http://localhost:8020](http://localhost:8020)
|
and open [localhost:8020](http://localhost:8020) in browser.
|
||||||
|
|
||||||
## Why
|
## Features
|
||||||
|
|
||||||
Substitute in your development `docker-compose.yaml` file standard redis image with this one, add port-mapping `-p 8020-8035:8020-8035`.
|
**Redis tools:**
|
||||||
Now in addition to Redis, you've got a whole set of tools with UIs, that allow you to explore you Redis database, get and set keys, import datasets,
|
|
||||||
install Redis modules and more.
|
|
||||||
|
|
||||||
__List of tools__
|
- [Redis-commander](https://github.com/joeferner/redis-commander#readme) - Redis web management tool.
|
||||||
|
- [Iredis](https://github.com/laixintao/iredis) - CLI for Redis with AutoCompletion and Syntax Highlighting.
|
||||||
- [Eclipse Theia](https://theia-ide.org/docs/)
|
- [Redis-dump](https://github.com/yannh/redis-dump-go) - dump Redis keys to a file.
|
||||||
|
- [Redis-Tui](https://github.com/mylxsw/redis-tui) - Redis Text-based UI client in CLI.
|
||||||
- [Redis extension for VS-Code](https://open-vsx.org/extension/cweijan/vscode-redis-client)
|
- [Redis extension for VS-Code](https://open-vsx.org/extension/cweijan/vscode-redis-client)
|
||||||
- [Iredis](https://github.com/laixintao/iredis)
|
|
||||||
- [Redis-dump](https://github.com/yannh/redis-dump-go)
|
|
||||||
- [Redis-Tui](https://github.com/mylxsw/redis-tui)
|
|
||||||
- [Redis-commander](https://github.com/joeferner/redis-commander#readme)
|
|
||||||
|
|
||||||
in addition - [the common workspace-in-docker toolset](https://github.com/bluxmit/alnoda-workspaces/tree/main/workspaces/workspace-in-docker).
|
**Dev tools:**
|
||||||
|
|
||||||
|
- [**Eclipse Theia**](https://theia-ide.org/docs/) - open source version of popular Visual Studio Code IDE. Theia is trully open-source, has
|
||||||
|
VS-Code extensions and works in browser. This means it can run inside a docker container on local machine or in cloud. A lot of beautiful color themes and many common plugins are already installed to save time.
|
||||||
|
- [**Terminal**](https://github.com/tsl0922/ttyd) - secure browser-based terminal.
|
||||||
|
- [**FileBrowser**](https://github.com/filebrowser/filebrowser) - manage files and folders inside the workspace, and exchange data between local environment and the workspace
|
||||||
|
- [**Cronicle**](https://github.com/jhuckaby/Cronicle) - task scheduler and runner, with a web based front-end UI. It handles both scheduled, repeating and on-demand jobs, targeting any number of worker servers, with real-time stats and live log viewer.
|
||||||
|
- [**Static File Server**](https://github.com/vercel/serve) - view any static html sites as easy as if you do it on your local machine. Serve static websites easily.
|
||||||
|
- [**Ungit**](https://github.com/FredrikNoren/ungit) - rings user friendliness to git without sacrificing the versatility of it.
|
||||||
|
- [**MkDocs**](https://squidfunk.github.io/mkdocs-material/) - create awesome documentation for your project with only markdown.
|
||||||
|
- [**Midnight Commander**](https://midnight-commander.org/) - Feature rich visual file manager with internal text viewer and editor.
|
||||||
|
- [**Process Monitor**](https://htop.dev/) - Monitor running process and resource utilization.
|
||||||
|
- Quicklaunch UI with getting started tutorial
|
||||||
|
|
||||||
### Get started
|
Image is built from **Ubuntu 20.4** with the additional CLI apps
|
||||||
|
|
||||||
Open workspace UI [http://localhost:800/](http://localhost:8020/) for quick access to all the tools
|
- [Zsh](https://www.zsh.org/), [Oh my Zsh](https://ohmyz.sh/)
|
||||||
|
- Python 3, Pip
|
||||||
|
- Node/nodeenv
|
||||||
|
- curl, wget, telnet, jq
|
||||||
|
- **Git:** git, git-flow, lazygit
|
||||||
|
- **File browsers:** mc, xplr
|
||||||
|
- **Text editors:** nano, vim, mcedit
|
||||||
|
- **System monitors:** ncdu, htop, glances, vizex
|
||||||
|
- **Process Control:** supervisord
|
||||||
|
- **Job scheduler:** cron
|
||||||
|
|
||||||
<p align="center">
|
## Docs
|
||||||
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/Redis-wid.png" alt="Redis WID" width="750">
|
See our guides on [**getting started**](docs/getting-started.md) and [**advanced features**](../ubuntu-workspace/docs/workspaces.md).
|
||||||
</p>
|
|
||||||
|
|
||||||
Use workspace terminal [http://localhost:8026/](http://localhost:8026/) and load some Redis datasets
|
|
||||||
```
|
|
||||||
git clone https://github.com/redis-developer/redis-datasets.git /home/project/redis-datasets
|
|
||||||
cat /home/project/redis-datasets/movie-database/import_actors.redis | redis-cli
|
|
||||||
cat /home/project/redis-datasets/movie-database/import_movies.redis | redis-cli
|
|
||||||
```
|
|
||||||
|
|
||||||
Open Redis Commander UI on [http://localhost:8029/](http://localhost:8029/) and explore Redis databases
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/Rediscommander.png" alt="Redis commander" width="750">
|
|
||||||
</p>
|
|
||||||
|
|
||||||
Alternatively use browser-based VS-code [http://localhost:8025/](http://localhost:8025/) with Redis extension
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/Theia-redis.png" alt="Theia" width="750">
|
|
||||||
</p>
|
|
||||||
|
|
||||||
In the Workspace terminal launch iredis CLI, get & set keys
|
|
||||||
```
|
|
||||||
iredis
|
|
||||||
iredis --newbie
|
|
||||||
```
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/iredis.png" alt="Iredis" width="400">
|
|
||||||
</p>
|
|
||||||
|
|
||||||
Create dump of the Redis database
|
|
||||||
```
|
|
||||||
redis-dump-go -h localhost > /home/redis-movie-dump.resp
|
|
||||||
```
|
|
||||||
Use File Browser [http://localhost:8021](http://localhost:8021) to get the dump to your PC
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Future extensions
|
|
||||||
- [phpRedisAdmin](https://github.com/erikdubbelboer/phpRedisAdmin)
|
|
||||||
|
|
50
workspaces/redis-workspace/docs/getting-started.md
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
# Get started
|
||||||
|
|
||||||
|
This doc has examples how to use workspace to interact with Redis.
|
||||||
|
|
||||||
|
In examples we use local Redis that is running inside the workspace, but the commands apply to any Redis instance.
|
||||||
|
|
||||||
|
|
||||||
|
## Tutorial
|
||||||
|
|
||||||
|
Open Quickstart page [http://localhost:800/](http://localhost:8020/) for quick access to all the tools
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/Redis-wid.png" alt="Redis WID" width="750">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
Use workspace terminal [http://localhost:8026/](http://localhost:8026/) and load some Redis datasets
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/redis-developer/redis-datasets.git /home/project/redis-datasets
|
||||||
|
cat /home/project/redis-datasets/movie-database/import_actors.redis | redis-cli
|
||||||
|
cat /home/project/redis-datasets/movie-database/import_movies.redis | redis-cli
|
||||||
|
```
|
||||||
|
|
||||||
|
Open Redis Commander UI on [http://localhost:8029/](http://localhost:8029/) and explore Redis databases
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/Rediscommander.png" alt="Redis commander" width="750">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
Alternatively use browser-based VS-code [http://localhost:8025/](http://localhost:8025/) with Redis extension
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/Theia-redis.png" alt="Theia" width="750">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
In the Workspace terminal launch iredis CLI, get & set keys
|
||||||
|
```
|
||||||
|
iredis
|
||||||
|
iredis --newbie
|
||||||
|
```
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/iredis.png" alt="Iredis" width="400">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
Create dump of the Redis database
|
||||||
|
```
|
||||||
|
redis-dump-go -h localhost > /home/redis-movie-dump.resp
|
||||||
|
```
|
||||||
|
Use File Browser [http://localhost:8021](http://localhost:8021) to get the dump to your PC
|
|
@ -1,28 +1,136 @@
|
||||||
**This is a starting point to create docs for this workspace!**
|
<style>
|
||||||
|
/* These styles apply only to this page! */
|
||||||
|
.md-content__button {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.md-sidebar--secondary{
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.md-typeset h1 {
|
||||||
|
line-height: 0;
|
||||||
|
margin: 0;
|
||||||
|
margin-left: -9999px;
|
||||||
|
}
|
||||||
|
.quickstart-wrapper {
|
||||||
|
min-width: 300px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
padding-left: -50px;
|
||||||
|
column-gap: 50px;
|
||||||
|
row-gap: 50px;
|
||||||
|
}
|
||||||
|
.quickstart-wrapper > div {
|
||||||
|
flex: 300px;
|
||||||
|
max-width: 300px;
|
||||||
|
}
|
||||||
|
.tool-img{
|
||||||
|
box-shadow: rgba(0, 0, 0, 0.24) 0px 5px 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
min-width: 300px;
|
||||||
|
max-width: 300px;
|
||||||
|
max-height: 170px;
|
||||||
|
min-height: 170px;
|
||||||
|
}
|
||||||
|
.tool-caption{
|
||||||
|
font-family: Roboto, Helvetica, sans-serif;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
> Don't neglect documentation for your workspace! Soon you will forget what you were doing with it.
|
/* font-size: 1.25em;
|
||||||
> This page exists for you to modify it, and write down everything you need to know next time you come here.
|
font-weight: 400; */
|
||||||
|
letter-spacing: -.02em;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
.tool-description{
|
||||||
|
font-family: Helvetica, sans-serif;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 0.7rem;
|
||||||
|
font-style: oblique;
|
||||||
|
/* font-weight: bold; */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
In order to change this page, simply modify the file `/home/docs/docs/README.md`. Changes will be applied automatically - the
|
|
||||||
server that serves this page has live reload.
|
|
||||||
|
|
||||||
In order to add a new doc file, it is enough to create a file in the folder `/home/docs/docs` and add respective entry
|
{%
|
||||||
to the configuratiion file `/home/docs/mkdcs.yaml`.
|
set tools = [
|
||||||
|
{
|
||||||
|
"env": "IDE_URL",
|
||||||
|
"name": "IDE",
|
||||||
|
"image": "assets/home/IDE.jpg",
|
||||||
|
"description": "Browser-based version of Visual Studio Code. Develop in any language, install hundreeds of extensions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": "TERMINAL_URL",
|
||||||
|
"name": "Terminal",
|
||||||
|
"image": "assets/home/Terminal.png",
|
||||||
|
"description": "Full-fledged browser-based terminal with Z-shell"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": "FILEBROWSER_URL",
|
||||||
|
"name": "File Browser",
|
||||||
|
"image": "assets/home/Filebrowser.png",
|
||||||
|
"description": "Browse, upload and download files and folders to and from the Workspace"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": "REDIS_COMMANDER_URL",
|
||||||
|
"name": "Redis Commander",
|
||||||
|
"image": "assets/home/Redis-commander.png",
|
||||||
|
"description": "Redis web management tool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": "CRONICLE_URL",
|
||||||
|
"name": "Cronicle",
|
||||||
|
"image": "assets/home/Cronicle.jpg",
|
||||||
|
"description": "Schedule jobs, manage schedules, observe and monitor executions (user/pass - admin/admin)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": "UNGIT_URL",
|
||||||
|
"name": "Ungit",
|
||||||
|
"image": "assets/home/Ungit.jpg",
|
||||||
|
"description": "Manage Git repositories and work flow using beautiful UI"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": "STATICFS_URL",
|
||||||
|
"name": "Static File Server",
|
||||||
|
"image": "assets/home/Static-server.png",
|
||||||
|
"description": "Serve any static websites like a breeze"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": "MC_URL",
|
||||||
|
"name": "M.Commander",
|
||||||
|
"image": "assets/home/MC.jpg",
|
||||||
|
"description": "Feature rich visual file manager with internal text viewer and editor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": "HTOP_URL",
|
||||||
|
"name": "Process monitor",
|
||||||
|
"image": "assets/home/Htop.jpg",
|
||||||
|
"description": "Monitor running process and resource utilization"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
%}
|
||||||
|
|
||||||
Open workspace terminal, and create new documentation file with some text at your will, and save changes
|
|
||||||
|
|
||||||
> `nano /home/docs/docs/new.md`
|
<div class="quickstart-wrapper">
|
||||||
|
{% for tool in tools %}
|
||||||
|
{% set tool_url = get_tool_url(tool.env) %}
|
||||||
|
<div>
|
||||||
|
<a href="{{ tool_url }}" target="_blank" rel="noopener noreferrer">
|
||||||
|
<img src="{{ tool.image }}" class="tool-img"/>
|
||||||
|
</a>
|
||||||
|
<a href="{{ tool_url }}">
|
||||||
|
<div class="tool-caption">{{ tool.name }}</div>
|
||||||
|
</a>
|
||||||
|
<div class="tool-description">{{ tool.description }}</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
edit file `mkdcs.yaml`
|
|
||||||
|
|
||||||
> `nano /home/docs/mkdcs.yaml`
|
|
||||||
|
|
||||||
Add record about the new file to **nav**, and save changes
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
nav:
|
|
||||||
- Home: pages/home/home.md
|
|
||||||
- About: README.md
|
|
||||||
- Get started: get-started.md
|
|
||||||
- New: new.md
|
|
||||||
```
|
|
Before Width: | Height: | Size: 250 KiB After Width: | Height: | Size: 250 KiB |
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 124 KiB |
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 192 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 652 KiB After Width: | Height: | Size: 652 KiB |
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 169 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 155 KiB After Width: | Height: | Size: 155 KiB |
|
@ -1,133 +0,0 @@
|
||||||
<style>
|
|
||||||
/* These styles apply only to this page! */
|
|
||||||
.md-content__button {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.md-typeset h1 {
|
|
||||||
line-height: 0;
|
|
||||||
margin: 0;
|
|
||||||
margin-left: -9999px;
|
|
||||||
}
|
|
||||||
.quickstart-wrapper {
|
|
||||||
min-width: 300px;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: center;
|
|
||||||
padding-left: -50px;
|
|
||||||
column-gap: 50px;
|
|
||||||
row-gap: 50px;
|
|
||||||
}
|
|
||||||
.quickstart-wrapper > div {
|
|
||||||
flex: 300px;
|
|
||||||
max-width: 300px;
|
|
||||||
}
|
|
||||||
.tool-img{
|
|
||||||
box-shadow: rgba(0, 0, 0, 0.24) 0px 5px 5px;
|
|
||||||
border-radius: 5px;
|
|
||||||
min-width: 300px;
|
|
||||||
max-width: 300px;
|
|
||||||
max-height: 170px;
|
|
||||||
min-height: 170px;
|
|
||||||
}
|
|
||||||
.tool-caption{
|
|
||||||
font-family: Roboto, Helvetica, sans-serif;
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 10px;
|
|
||||||
font-size: 1.2rem;
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
/* font-size: 1.25em;
|
|
||||||
font-weight: 400; */
|
|
||||||
letter-spacing: -.02em;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
.tool-description{
|
|
||||||
font-family: Helvetica, sans-serif;
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 10px;
|
|
||||||
font-size: 0.7rem;
|
|
||||||
font-style: oblique;
|
|
||||||
/* font-weight: bold; */
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
|
|
||||||
{%
|
|
||||||
set tools = [
|
|
||||||
{
|
|
||||||
"env": "IDE_URL",
|
|
||||||
"name": "IDE",
|
|
||||||
"image": "IDE.jpg",
|
|
||||||
"description": "Browser-based version of Visual Studio Code. Develop in any language, install hundreeds of extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"env": "TERMINAL_URL",
|
|
||||||
"name": "Terminal",
|
|
||||||
"image": "Terminal.png",
|
|
||||||
"description": "Full-fledged browser-based terminal with Z-shell"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"env": "FILEBROWSER_URL",
|
|
||||||
"name": "File Browser",
|
|
||||||
"image": "Filebrowser.png",
|
|
||||||
"description": "Browse, upload and download files and folders to and from the Workspace"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"env": "REDIS_COMMANDER_URL",
|
|
||||||
"name": "Redis Commander",
|
|
||||||
"image": "Redis-commander.png",
|
|
||||||
"description": "Redis web management tool"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"env": "CRONICLE_URL",
|
|
||||||
"name": "Cronicle",
|
|
||||||
"image": "Cronicle.jpg",
|
|
||||||
"description": "Schedule jobs, manage schedules, observe and monitor executions (user/pass - admin/admin)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"env": "UNGIT_URL",
|
|
||||||
"name": "Ungit",
|
|
||||||
"image": "Ungit.jpg",
|
|
||||||
"description": "Manage Git repositories and work flow using beautiful UI"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"env": "STATICFS_URL",
|
|
||||||
"name": "Static File Server",
|
|
||||||
"image": "Static-server.png",
|
|
||||||
"description": "Serve any static websites like a breeze"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"env": "MC_URL",
|
|
||||||
"name": "M.Commander",
|
|
||||||
"image": "MC.jpg",
|
|
||||||
"description": "Feature rich visual file manager with internal text viewer and editor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"env": "HTOP_URL",
|
|
||||||
"name": "Process monitor",
|
|
||||||
"image": "Htop.jpg",
|
|
||||||
"description": "Monitor running process and resource utilization"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
%}
|
|
||||||
|
|
||||||
|
|
||||||
<div class="quickstart-wrapper">
|
|
||||||
{% for tool in tools %}
|
|
||||||
{% set tool_url = get_tool_url(tool.env) %}
|
|
||||||
<div>
|
|
||||||
<a href="{{ tool_url }}" target="_blank" rel="noopener noreferrer">
|
|
||||||
<img src="{{ tool.image }}" class="tool-img"/>
|
|
||||||
</a>
|
|
||||||
<a href="{{ tool_url }}">
|
|
||||||
<div class="tool-caption">{{ tool.name }}</div>
|
|
||||||
</a>
|
|
||||||
<div class="tool-description">{{ tool.description }}</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
# ===========================================================
|
# ===========================================================
|
||||||
|
|
||||||
nav:
|
nav:
|
||||||
- Home: pages/home/home.md
|
- Home: README.md
|
||||||
- About: README.md
|
- Get started: getting-started.md
|
||||||
- Docs: docs.md
|
|
||||||
|
|
||||||
|
|
||||||
# ===========================================================
|
# ===========================================================
|
||||||
|
|
|
@ -1,237 +1,74 @@
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://github.com/bluxmit/alnoda-workspaces/blob/main/img/Alnoda-white.svg" alt="Alnoda logo" width="150">
|
||||||
|
</p>
|
||||||
|
|
||||||
# SQLite Workspace
|
# SQLite Workspace
|
||||||
|
|
||||||
Collection of tools to develop SQLite databases. Useful if you need to create an embedded database for your application,
|
Collection of tools to develop SQLite databases.
|
||||||
and fill it with data.
|
|
||||||
|
|
||||||
Helps to get started fast locally, because SQLite and toolset are already installed and configured. It is only needed
|
## Why this images
|
||||||
to start a container.
|
|
||||||
|
|
||||||
Also can be self-hosted and used for collaboration when developing embedded database.
|
1. If you need to develop embedded SQLite database and fill it with data.
|
||||||
|
|
||||||
__Try it out:__
|
## Start
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run --name space-1 -d -p 8020-8035:8020-8035 alnoda/sqlite-workspace
|
docker run --name space-1 -d -p 8020-8035:8020-8035 alnoda/sqlite-workspace
|
||||||
```
|
```
|
||||||
Open [localhost:8020](http://localhost:8020)
|
|
||||||
|
|
||||||
|
and open [localhost:8020](http://localhost:8020) in browser.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
__SQLite Features:__
|
**SQLite tools:**
|
||||||
|
|
||||||
1. [sqlean](https://github.com/nalgeon/sqlean). The ultimate set of compiled SQLite extensions.
|
- [nocodb](https://docs.nocodb.com/) - great UI to fill SQLite with data. NocoDB is an open source Airtable alternative.
|
||||||
2. [nocodb](https://docs.nocodb.com/). Great UI to fill SQLite with data. NocoDB is an open source Airtable alternative.
|
- [sqlite-web](https://github.com/coleifer/sqlite-web) - web-based SQLite database browser.
|
||||||
3. [sqlite-web](https://github.com/coleifer/sqlite-web). Web-based SQLite database browser.
|
- [sqlean](https://github.com/nalgeon/sqlean) - the ultimate set of compiled SQLite extensions.
|
||||||
4. [litecli](https://github.com/dbcli/litecli). CLI for SQLite.
|
- [litecli](https://github.com/dbcli/litecli) - CLI for SQLite.
|
||||||
5. [sqlite-viewer](https://github.com/inloop/sqlite-viewer). View SQLite file online.
|
- [sqlite-viewer](https://github.com/inloop/sqlite-viewer) - view SQLite file online.
|
||||||
6. [Web-GUI-for-SQLite](https://github.com/cyrilbois/Web-GUI-for-SQLite). Alternative tool to view SQLite file online.
|
- [Web-GUI-for-SQLite](https://github.com/cyrilbois/Web-GUI-for-SQLite) - alternative tool to view SQLite file online.
|
||||||
7. [DBdesigner](https://github.com/akreienbring/dbdesigner). Draw ERD diagrams and use it to generate DDL code.
|
- [DBdesigner](https://github.com/akreienbring/dbdesigner) - draw ERD diagrams and use it to generate DDL code.
|
||||||
8. [tbls](https://github.com/k1LoW/tbls). Generate documentation (essentially data catalog) from the database
|
- [tbls](https://github.com/k1LoW/tbls) - gnerate documentation (essentially data catalog) from the database
|
||||||
|
|
||||||
__Workspace Features:__
|
**SQLite extension:**
|
||||||
|
|
||||||
1. [Browser-based VS-code](https://theia-ide.org/) with extensions:
|
- [crypto](https://github.com/nalgeon/sqlean/blob/main/docs/crypto.md) - secure hashes
|
||||||
- [PostgreSQL Client for vscode](https://open-vsx.org/extension/cweijan/vscode-postgresql-client2)
|
- [fileio](https://github.com/nalgeon/sqlean/blob/main/docs/fileio.md) - read and write files
|
||||||
- [SQLTools PostgreSQL](https://open-vsx.org/extension/mtxr/sqltools-driver-pg)
|
- [fuzzy](https://github.com/nalgeon/sqlean/blob/main/docs/fuzzy.md) - fuzzy string matching and phonetics
|
||||||
2. Browser-based terminal. Finally no need to ssh into a running docker container.
|
- [ipaddr](https://github.com/nalgeon/sqlean/blob/main/docs/ipaddr.md): - IP address manipulation
|
||||||
3. [Cronicle](https://github.com/jhuckaby/Cronicle). Browser-based jobs scheduler. Schedule backups, data extracts, maintenance scripts.
|
- [re](https://github.com/nalgeon/sqlean/blob/main/docs/re.md) - regular expressions
|
||||||
4. Ubuntu with many apps installed:
|
- [stats](https://github.com/nalgeon/sqlean/blob/main/docs/stats.md) - math statistics
|
||||||
- text editors
|
- [text](https://github.com/nalgeon/sqlean/blob/main/docs/text.md) - string functions
|
||||||
- [Zsh](https://ohmyz.sh/)
|
- [unicode](https://github.com/nalgeon/sqlean/blob/main/docs/unicode.md) - Unicode support
|
||||||
- cron
|
- [uuid](https://github.com/nalgeon/sqlean/blob/main/docs/uuid.md) - universally Unique IDentifiers
|
||||||
- mc
|
|
||||||
- and many more
|
|
||||||
5. [Rclone](https://rclone.org/). Save SQLite databases to S3.
|
|
||||||
6. Programming languages. Develop/execute directly inside the workspace using browser-based IDE.
|
|
||||||
- python
|
|
||||||
- nodejs
|
|
||||||
7. [Filebrowser](https://github.com/filebrowser/filebrowser). Browse and download files (finally no need to mount folders for that).
|
|
||||||
8. [Static file server](https://github.com/vercel/serve). View generated HTML reports.
|
|
||||||
9. [Ungit](https://github.com/FredrikNoren/ungit). The easiest way to use git.
|
|
||||||
10. Browser-based process and resource utilization monitor
|
|
||||||
11. [Mkdocs](https://www.mkdocs.org/). Create documentation with Markdown.
|
|
||||||
12. Workspace own UI, from which you can open all applications and documentation.
|
|
||||||
|
|
||||||
## Get started
|
**Dev tools:**
|
||||||
|
|
||||||
### NocoDB
|
- [**Eclipse Theia**](https://theia-ide.org/docs/) - open source version of popular Visual Studio Code IDE. Theia is trully open-source, has
|
||||||
|
VS-Code extensions and works in browser. This means it can run inside a docker container on local machine or in cloud. A lot of beautiful color themes and many common plugins are already installed to save time.
|
||||||
|
- [**Terminal**](https://github.com/tsl0922/ttyd) - secure browser-based terminal.
|
||||||
|
- [**FileBrowser**](https://github.com/filebrowser/filebrowser) - manage files and folders inside the workspace, and exchange data between local environment and the workspace
|
||||||
|
- [**Cronicle**](https://github.com/jhuckaby/Cronicle) - task scheduler and runner, with a web based front-end UI. It handles both scheduled, repeating and on-demand jobs, targeting any number of worker servers, with real-time stats and live log viewer.
|
||||||
|
- [**Static File Server**](https://github.com/vercel/serve) - view any static html sites as easy as if you do it on your local machine. Serve static websites easily.
|
||||||
|
- [**Ungit**](https://github.com/FredrikNoren/ungit) - rings user friendliness to git without sacrificing the versatility of it.
|
||||||
|
- [**MkDocs**](https://squidfunk.github.io/mkdocs-material/) - create awesome documentation for your project with only markdown.
|
||||||
|
- [**Midnight Commander**](https://midnight-commander.org/) - Feature rich visual file manager with internal text viewer and editor.
|
||||||
|
- [**Process Monitor**](https://htop.dev/) - Monitor running process and resource utilization.
|
||||||
|
- Quicklaunch UI with getting started tutorial
|
||||||
|
|
||||||
[NocoDB](https://docs.nocodb.com/). NocoDB is an open source Airtable alternative. Use it to create SQLite tables, develop databases
|
Image is built from **Ubuntu 20.4** with the additional CLI apps
|
||||||
without SQL.
|
|
||||||
|
|
||||||
Launch the workspace, navigate to the Workspace UI and open NocoDB. Or open [localhost:8030](http://localhost:8030/) directly in browser.
|
- [Zsh](https://www.zsh.org/), [Oh my Zsh](https://ohmyz.sh/)
|
||||||
Create new user (provide any email,pass). Create tables, enter data, import data files, create forms and much more.
|
- Python 3, Pip
|
||||||
|
- Node/nodeenv
|
||||||
|
- curl, wget, telnet, jq
|
||||||
|
- **Git:** git, git-flow, lazygit
|
||||||
|
- **File browsers:** mc, xplr
|
||||||
|
- **Text editors:** nano, vim, mcedit
|
||||||
|
- **System monitors:** ncdu, htop, glances, vizex
|
||||||
|
- **Process Control:** supervisord
|
||||||
|
- **Job scheduler:** cron
|
||||||
|
|
||||||
#### query NocoDB data
|
## Docs
|
||||||
NocoDB is backed by SQLite3, database file `/home/nocodb/noco.db `.
|
See our guides on [**getting started**](docs/getting-started.md) and [**advanced features**](../ubuntu-workspace/docs/workspaces.md).
|
||||||
|
|
||||||
You can query NocoDB databse directly with sqlite-web. Open it through the Workspace UI, or navigate to [localhost:8031](http://localhost:8031/) directly.
|
|
||||||
|
|
||||||
At any moment you can copy SQLite database from NocoDB with all the data, edit, modify and configure for the needs of your application.
|
|
||||||
- Copy of NocoDB database and continue developing with Sqlite-web
|
|
||||||
```
|
|
||||||
mv -f /home/nocodb/noco.db /home/project/sqlite-db/db-main.sqlite
|
|
||||||
```
|
|
||||||
Open Sqlite-web on [localhost:8032](http://localhost:8032/)
|
|
||||||
|
|
||||||
#### NocoDB with another SQLite database
|
|
||||||
|
|
||||||
If yopu create NocoDB project with external database, tables created by NocoDB will not have prefixes.
|
|
||||||
|
|
||||||
For example, create project with the example Chinook SQLite database file `/home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite`,
|
|
||||||
and query data also with sqlite-web on [localhost:8033](http://localhost:8033/).
|
|
||||||
|
|
||||||
Or create NocoDB project with external SQLite database file `/home/project/sqlite-db/db-main.sqlite` and query with sqlite-web on [localhost:8032](http://localhost:8032/).
|
|
||||||
|
|
||||||
|
|
||||||
### Sqlite
|
|
||||||
|
|
||||||
SQLite3 is installed. Open terminal [http://localhost:8026/](http://localhost:8026/) and execute
|
|
||||||
|
|
||||||
```
|
|
||||||
sqlite3
|
|
||||||
```
|
|
||||||
|
|
||||||
__Note:__ tcheck out a better CLI [litecli](#litecli)
|
|
||||||
|
|
||||||
|
|
||||||
### Sqlite extensions
|
|
||||||
|
|
||||||
The following compiled extensions are present in the folder `/home/sqlite-extensions`
|
|
||||||
|
|
||||||
- [crypto](https://github.com/nalgeon/sqlean/blob/main/docs/crypto.md): secure hashes
|
|
||||||
- [fileio](https://github.com/nalgeon/sqlean/blob/main/docs/fileio.md): read and write files
|
|
||||||
- [fuzzy](https://github.com/nalgeon/sqlean/blob/main/docs/fuzzy.md): fuzzy string matching and phonetics
|
|
||||||
- [ipaddr](https://github.com/nalgeon/sqlean/blob/main/docs/ipaddr.md): IP address manipulation
|
|
||||||
- [re](https://github.com/nalgeon/sqlean/blob/main/docs/re.md): regular expressions
|
|
||||||
- [stats](https://github.com/nalgeon/sqlean/blob/main/docs/stats.md): math statistics
|
|
||||||
- [text](https://github.com/nalgeon/sqlean/blob/main/docs/text.md): string functions
|
|
||||||
- [unicode](https://github.com/nalgeon/sqlean/blob/main/docs/unicode.md): Unicode support
|
|
||||||
- [uuid](https://github.com/nalgeon/sqlean/blob/main/docs/uuid.md): Universally Unique IDentifiers
|
|
||||||
|
|
||||||
Example start SQLite, and load extension:
|
|
||||||
|
|
||||||
```
|
|
||||||
sqlite3
|
|
||||||
.load /home/sqlite-extensions/stats
|
|
||||||
```
|
|
||||||
|
|
||||||
### [sqlite-web](https://github.com/coleifer/sqlite-web)
|
|
||||||
|
|
||||||
Serve any SQLite database. There are 2 SQlite database served by default:
|
|
||||||
- NocoDB database. Sqlite-web is served on [localhost:8031](http://localhost:8031/)
|
|
||||||
- "Main" database. Empty SQlite3 database. Sqlite-web is served on [localhost:8032](http://localhost:8032/)
|
|
||||||
- "Example/test" database. Filled with test "Chinook" database. Sqlite-web is served on [localhost:8033](http://localhost:8033/)
|
|
||||||
|
|
||||||
|
|
||||||
#### Copy SQlite databases
|
|
||||||
SQlite is just a file, jou can copy it and replace other databases. For example, if you want to copy NocoDB database
|
|
||||||
into the "Main" database, which is served by Sqlite-web on [localhost:8032](http://localhost:8032/) simply execute
|
|
||||||
```
|
|
||||||
mv -f /home/nocodb/noco.db /home/project/sqlite-db/db-main.sqlite
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Serve on-demand SQlite database
|
|
||||||
One port 8034 is reserved for serving on-demand database with Sqlite-web.
|
|
||||||
Serve it with the following command
|
|
||||||
```
|
|
||||||
sqlite_web <path-to-your-sqlite-database-file> --host 0.0.0.0 --port 8034
|
|
||||||
```
|
|
||||||
|
|
||||||
Example, start sqlite-web on port 8034 for SQLite database file `/home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite`
|
|
||||||
|
|
||||||
```
|
|
||||||
sqlite_web /home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite --host 0.0.0.0 --port 8034
|
|
||||||
```
|
|
||||||
|
|
||||||
and with extensions loaded:
|
|
||||||
|
|
||||||
```
|
|
||||||
sqlite_web /home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite --host 0.0.0.0 --port 8034 -e /home/sqlite-extensions/text.so -e /home/sqlite-extensions/unicode.so -e /home/sqlite-extensions/uuid.so
|
|
||||||
```
|
|
||||||
|
|
||||||
### [sqlite-viewer](https://github.com/inloop/sqlite-viewer). View SQLite file online.
|
|
||||||
|
|
||||||
Upload SQLite database file (from your local machine) and explore.
|
|
||||||
|
|
||||||
|
|
||||||
### [Web-GUI-for-SQLite](https://github.com/cyrilbois/Web-GUI-for-SQLite)
|
|
||||||
|
|
||||||
Upload SQLite database file (from your local machine) and explore.
|
|
||||||
|
|
||||||
|
|
||||||
### [litecli](https://github.com/dbcli/litecli)
|
|
||||||
A command-line client for SQLite databases that has auto-completion and syntax highlighting. Useful if you prefer CLI.
|
|
||||||
|
|
||||||
Open Terminal and try with example database:
|
|
||||||
|
|
||||||
```
|
|
||||||
litecli /home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite
|
|
||||||
```
|
|
||||||
|
|
||||||
Load extensions
|
|
||||||
|
|
||||||
```
|
|
||||||
.load /home/sqlite-extensions/stats
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Advanced
|
|
||||||
|
|
||||||
### SQLite Json
|
|
||||||
Examples
|
|
||||||
|
|
||||||
```
|
|
||||||
CREATE TABLE jsontest (
|
|
||||||
id INTEGER NOT NULL PRIMARY KEY,
|
|
||||||
jss JSON
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO jsontest VALUES
|
|
||||||
(1, json(' { "key1" : "my key 1", "key2": [ "test" ] } ')),
|
|
||||||
(2, json(' { "key1" : "my new key", "key2": [ "test", "test" ] } ')),
|
|
||||||
(3, json(' { "key1" : "my yet another key", "key2": [ "test", "test", "test2" ] } '));
|
|
||||||
|
|
||||||
SELECT * FROM jsontest;
|
|
||||||
```
|
|
||||||
|
|
||||||
__Links:__
|
|
||||||
- [Complete SQlite JSON docs](https://www.sqlite.org/json1.html#jmini)
|
|
||||||
|
|
||||||
|
|
||||||
### rclone
|
|
||||||
[rclone](https://rclone.org/) is a command line program to manage files on cloud storage.
|
|
||||||
It is a feature rich alternative to cloud vendors' web storage interfaces.
|
|
||||||
__Copy dump to S3:__
|
|
||||||
Create file `~/.config/rclone/rclone.conf` with the following content
|
|
||||||
```
|
|
||||||
[remote]
|
|
||||||
type = s3
|
|
||||||
provider = AWS
|
|
||||||
access_key_id = XXXXXXXXXXXXXXXXXXXXXX
|
|
||||||
secret_access_key = XXxxXXxXXXxxxXXxXXXxxXXXxxxXXXxXXXX
|
|
||||||
region = xx-xxxx-x
|
|
||||||
```
|
|
||||||
Use Rclone to copy to S3 and delete from local
|
|
||||||
```
|
|
||||||
rclone move /home/project/sqlite-db remote:my-s3-bucket/sqlite/
|
|
||||||
```
|
|
||||||
__Restore from S3 to local:__
|
|
||||||
When there is a need to get database from S3 to local folder.
|
|
||||||
```
|
|
||||||
# copy
|
|
||||||
rclone copy remote:my-s3-bucket/sqlite/ /home/sqlite-db/
|
|
||||||
# mount S3 without copying
|
|
||||||
rclone sync remote:my-s3-bucket/sqlite/ /home/sqlite-db/
|
|
||||||
```
|
|
||||||
|
|
||||||
### tbls
|
|
||||||
|
|
||||||
Generate docs for the example database
|
|
||||||
|
|
||||||
```
|
|
||||||
tbls doc sqlite:////home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite /home/static-server/sql-tbls
|
|
||||||
```
|
|
||||||
|
|
||||||
and view SVG files with Static File Server
|
|
||||||
|
|
205
workspaces/sqlite-workspace/docs/getting-started.md
Normal file
|
@ -0,0 +1,205 @@
|
||||||
|
# Get started
|
||||||
|
|
||||||
|
This doc has examples how to use workspace toolset to develop and fill SQLite databases.
|
||||||
|
|
||||||
|
Open Quickstart page [http://localhost:800/](http://localhost:8020/) for quick access to all the tools
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/redis-workspace/img/Redis-wid.png" alt="Redis WID" width="750">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
Use workspace terminal [http://localhost:8026/](http://localhost:8026/) for CLI commands.
|
||||||
|
|
||||||
|
## NocoDB
|
||||||
|
|
||||||
|
[NocoDB](https://docs.nocodb.com/). NocoDB is an open source Airtable alternative. Use it to create SQLite tables, develop databases
|
||||||
|
without SQL.
|
||||||
|
|
||||||
|
Launch the workspace, navigate to the Workspace UI and open NocoDB. Or open [localhost:8030](http://localhost:8030/) directly in browser.
|
||||||
|
Create new user (provide any email,pass). Create tables, enter data, import data files, create forms and much more.
|
||||||
|
|
||||||
|
### query NocoDB data
|
||||||
|
|
||||||
|
NocoDB is backed by SQLite3, database file `/home/nocodb/noco.db `.
|
||||||
|
|
||||||
|
You can query NocoDB databse directly with sqlite-web. Open it through the Workspace UI, or navigate to [localhost:8031](http://localhost:8031/) directly.
|
||||||
|
|
||||||
|
At any moment you can copy SQLite database from NocoDB with all the data, edit, modify and configure for the needs of your application.
|
||||||
|
- Copy of NocoDB database and continue developing with Sqlite-web
|
||||||
|
```
|
||||||
|
mv -f /home/nocodb/noco.db /home/project/sqlite-db/db-main.sqlite
|
||||||
|
```
|
||||||
|
Open Sqlite-web on [localhost:8032](http://localhost:8032/)
|
||||||
|
|
||||||
|
### NocoDB with another SQLite database
|
||||||
|
|
||||||
|
If yopu create NocoDB project with external database, tables created by NocoDB will not have prefixes.
|
||||||
|
|
||||||
|
For example, create project with the example Chinook SQLite database file `/home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite`,
|
||||||
|
and query data also with sqlite-web on [localhost:8033](http://localhost:8033/).
|
||||||
|
|
||||||
|
Or create NocoDB project with external SQLite database file `/home/project/sqlite-db/db-main.sqlite` and query with sqlite-web on [localhost:8032](http://localhost:8032/).
|
||||||
|
|
||||||
|
## Sqlite
|
||||||
|
|
||||||
|
SQLite3 is installed. Open terminal [http://localhost:8026/](http://localhost:8026/) and execute
|
||||||
|
|
||||||
|
```
|
||||||
|
sqlite3
|
||||||
|
```
|
||||||
|
|
||||||
|
__Note:__ tcheck out a better CLI [litecli](#litecli)
|
||||||
|
|
||||||
|
### Sqlite extensions
|
||||||
|
|
||||||
|
The following compiled extensions are present in the folder `/home/sqlite-extensions`
|
||||||
|
|
||||||
|
- [crypto](https://github.com/nalgeon/sqlean/blob/main/docs/crypto.md): secure hashes
|
||||||
|
- [fileio](https://github.com/nalgeon/sqlean/blob/main/docs/fileio.md): read and write files
|
||||||
|
- [fuzzy](https://github.com/nalgeon/sqlean/blob/main/docs/fuzzy.md): fuzzy string matching and phonetics
|
||||||
|
- [ipaddr](https://github.com/nalgeon/sqlean/blob/main/docs/ipaddr.md): IP address manipulation
|
||||||
|
- [re](https://github.com/nalgeon/sqlean/blob/main/docs/re.md): regular expressions
|
||||||
|
- [stats](https://github.com/nalgeon/sqlean/blob/main/docs/stats.md): math statistics
|
||||||
|
- [text](https://github.com/nalgeon/sqlean/blob/main/docs/text.md): string functions
|
||||||
|
- [unicode](https://github.com/nalgeon/sqlean/blob/main/docs/unicode.md): Unicode support
|
||||||
|
- [uuid](https://github.com/nalgeon/sqlean/blob/main/docs/uuid.md): Universally Unique IDentifiers
|
||||||
|
|
||||||
|
Example start SQLite, and load extension:
|
||||||
|
|
||||||
|
```
|
||||||
|
sqlite3
|
||||||
|
.load /home/sqlite-extensions/stats
|
||||||
|
```
|
||||||
|
|
||||||
|
### Copy SQlite databases
|
||||||
|
|
||||||
|
SQlite is just a file, jou can copy it and replace other databases. For example, if you want to copy NocoDB database
|
||||||
|
into the "Main" database, which is served by Sqlite-web on [localhost:8032](http://localhost:8032/) simply execute
|
||||||
|
|
||||||
|
```
|
||||||
|
mv -f /home/nocodb/noco.db /home/project/sqlite-db/db-main.sqlite
|
||||||
|
```
|
||||||
|
|
||||||
|
## [sqlite-web](https://github.com/coleifer/sqlite-web)
|
||||||
|
|
||||||
|
Serve any SQLite database. There are 2 SQlite database served by default:
|
||||||
|
|
||||||
|
- NocoDB database. Sqlite-web is served on [localhost:8031](http://localhost:8031/)
|
||||||
|
- "Main" database. Empty SQlite3 database. Sqlite-web is served on [localhost:8032](http://localhost:8032/)
|
||||||
|
- "Example/test" database. Filled with test "Chinook" database. Sqlite-web is served on [localhost:8033](http://localhost:8033/)
|
||||||
|
|
||||||
|
### Serve on-demand SQlite database
|
||||||
|
|
||||||
|
One port 8034 is reserved for serving on-demand database with Sqlite-web.
|
||||||
|
Serve it with the following command
|
||||||
|
|
||||||
|
```
|
||||||
|
sqlite_web <path-to-your-sqlite-database-file> --host 0.0.0.0 --port 8034
|
||||||
|
```
|
||||||
|
|
||||||
|
Example, start sqlite-web on port 8034 for SQLite database file `/home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite`
|
||||||
|
|
||||||
|
```
|
||||||
|
sqlite_web /home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite --host 0.0.0.0 --port 8034
|
||||||
|
```
|
||||||
|
|
||||||
|
and with extensions loaded:
|
||||||
|
|
||||||
|
```
|
||||||
|
sqlite_web /home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite --host 0.0.0.0 --port 8034 -e /home/sqlite-extensions/text.so -e /home/sqlite-extensions/unicode.so -e /home/sqlite-extensions/uuid.so
|
||||||
|
```
|
||||||
|
|
||||||
|
## [sqlite-viewer](https://github.com/inloop/sqlite-viewer).
|
||||||
|
|
||||||
|
Explore and query SQLite databases. Upload SQLite database file (from your local machine) and explore.
|
||||||
|
|
||||||
|
|
||||||
|
## [Web-GUI-for-SQLite](https://github.com/cyrilbois/Web-GUI-for-SQLite)
|
||||||
|
|
||||||
|
Explore and query SQLite databases. Upload SQLite database file (from your local machine) and explore.
|
||||||
|
|
||||||
|
|
||||||
|
## [litecli](https://github.com/dbcli/litecli)
|
||||||
|
|
||||||
|
A command-line client for SQLite databases that has auto-completion and syntax highlighting. Useful if you prefer CLI.
|
||||||
|
|
||||||
|
Open Terminal and try with example database:
|
||||||
|
|
||||||
|
```
|
||||||
|
litecli /home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite
|
||||||
|
```
|
||||||
|
|
||||||
|
Load extensions
|
||||||
|
|
||||||
|
```
|
||||||
|
.load /home/sqlite-extensions/stats
|
||||||
|
```
|
||||||
|
|
||||||
|
### Tbls
|
||||||
|
|
||||||
|
Generate docs for the example database
|
||||||
|
|
||||||
|
```
|
||||||
|
tbls doc sqlite:////home/static-server/sqlite-viewer/examples/Chinook_Sqlite.sqlite /home/static-server/sql-tbls
|
||||||
|
```
|
||||||
|
|
||||||
|
and view SVG files with Static File Server
|
||||||
|
|
||||||
|
|
||||||
|
## Advanced
|
||||||
|
|
||||||
|
### SQLite Json
|
||||||
|
|
||||||
|
Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
CREATE TABLE jsontest (
|
||||||
|
id INTEGER NOT NULL PRIMARY KEY,
|
||||||
|
jss JSON
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO jsontest VALUES
|
||||||
|
(1, json(' { "key1" : "my key 1", "key2": [ "test" ] } ')),
|
||||||
|
(2, json(' { "key1" : "my new key", "key2": [ "test", "test" ] } ')),
|
||||||
|
(3, json(' { "key1" : "my yet another key", "key2": [ "test", "test", "test2" ] } '));
|
||||||
|
|
||||||
|
SELECT * FROM jsontest;
|
||||||
|
```
|
||||||
|
|
||||||
|
__Links:__
|
||||||
|
- [Complete SQlite JSON docs](https://www.sqlite.org/json1.html#jmini)
|
||||||
|
|
||||||
|
|
||||||
|
### Rclone
|
||||||
|
|
||||||
|
[rclone](https://rclone.org/) is a command line program to manage files on cloud storage.
|
||||||
|
It is a feature rich alternative to cloud vendors' web storage interfaces.
|
||||||
|
|
||||||
|
__Copy dump to S3:__
|
||||||
|
Create file `~/.config/rclone/rclone.conf` with the following content
|
||||||
|
|
||||||
|
```
|
||||||
|
[remote]
|
||||||
|
type = s3
|
||||||
|
provider = AWS
|
||||||
|
access_key_id = XXXXXXXXXXXXXXXXXXXXXX
|
||||||
|
secret_access_key = XXxxXXxXXXxxxXXxXXXxxXXXxxxXXXxXXXX
|
||||||
|
region = xx-xxxx-x
|
||||||
|
```
|
||||||
|
|
||||||
|
Use Rclone to copy to S3 and delete from local
|
||||||
|
|
||||||
|
```
|
||||||
|
rclone move /home/project/sqlite-db remote:my-s3-bucket/sqlite/
|
||||||
|
```
|
||||||
|
|
||||||
|
__Restore from S3 to local:__
|
||||||
|
When there is a need to get database from S3 to local folder.
|
||||||
|
|
||||||
|
```
|
||||||
|
# copy
|
||||||
|
rclone copy remote:my-s3-bucket/sqlite/ /home/sqlite-db/
|
||||||
|
# mount S3 without copying
|
||||||
|
rclone sync remote:my-s3-bucket/sqlite/ /home/sqlite-db/
|
||||||
|
```
|
||||||
|
|