Git Product home page Git Product logo

paraswaykole / slashbase Goto Github PK

View Code? Open in Web Editor NEW
1.3K 1.3K 71.0 3.87 MB

Modern database IDE for your dev & data workflows. Supports MySQL, PostgreSQL & MongoDB.

Home Page: https://slashbase.com

License: Apache License 2.0

Go 44.35% Makefile 0.19% HTML 0.09% TypeScript 50.10% SCSS 1.51% CSS 0.38% NSIS 1.50% JavaScript 0.71% Dockerfile 0.17% Shell 1.00%
database database-client database-management databases go golang ide mongo mongo-db mongodb mongosh mysql mysql-client mysql-workbench pgadmin phpmyadmin postgres postgresql sql sql-editor

slashbase's People

Contributors

codezuma avatar daeraxa avatar deanrtaylor1 avatar dozheiny avatar dr-coton avatar eldemarkki avatar lagerfeuer avatar naman-dave avatar nc1337 avatar nitishrddy avatar paraswaykole avatar prafukl avatar prashantkhandelwal avatar priyankabbb avatar rjpatil27 avatar samantatarun avatar sanyamjain04 avatar utkarsh575 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slashbase's Issues

Unable to connect to MongoDB if password has special characters.

Unable to connect to MongoDB if there are special characters in the password.

For example: I was connecting to the database I have in Azure VM with a password which has '@' in it. The connection was failing as the special character has to be converted into Hexadecimal ASCII i.e. '@' will convert to '%40'. After this change, I was able to connect to the database.

I have made changes in this commit. @paraswaykole you can take a look and if all these changes seems okay, then I can raise a PR for this or if there is some other better way of doing this.

Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

Downloading the binary file without Docker & running gives an error

❯ slashbase
Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

mostly because the release binaries has an indirect dependency on go-sqlite3 which in turn needs to be built with CGO

Steps to reproduce

  1. download slashbase binary from release page (linux_amd64.zip)
  2. add slashbase to path or move to ~/.local/bin
  3. run slashbase & see the error

Possible fix

Add 'CGO_ENABLED=1' to go build release command

Permission issue while running binary on server

  • Replaced var build = config.BUILD_SERVER to BUILD_SERVER
  • On my main.go file level created a docker-compose fiel with contents
version: '3.8'

services:
  slashbase-db:
    image: postgres
    container_name: slashbase-db
    restart: always
    ports:
      - '5432:5432'
    volumes:
      - ./data/postgres/data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: petclinic
      POSTGRES_USER: petclinic
      POSTGRES_PASSWORD: petclinic
    healthcheck:
      test: pg_isready -U petclinic -d petclinic
      interval: 5s
      timeout: 5s
      retries: 3
  • In development.server.env passed the values
APP_DB_HOST=localhost
APP_DB_PORT=5432
APP_DB_USER=petclinic
APP_DB_PASS=petclinic
APP_DB_NAME=petclinic
  • always I get the permission with data.
image * I understand a solution would be to give chmod , but to no avail, similar issue happens. * When worked with docker image it works fine. * Any viable solution?

Test PostgreSQL queries

Run the slashbase app on your local machine, connect to a Postgres db and try running all different kind of queries supported by PostgreSQL and file a bug in the issues if any query doesn't work.

ID Sequence for Postgresql not being updated when adding items from UI

I was trying slashbase out after installing postgresql and creating a posts database with the following schema:

CREATE TABLE posts (id BIGSERIAL PRIMARY KEY, title TEXT, content TEXT);

When I added a tuple in the table via the slashbase UI, I expected the id field to be updated automatically.
image

However the UI showed the value for the id column as NULL.
image

Even though it showed the id field with the correct value within the slashbase CLI.
image

Note that I had to reload the page (in my case I clicked the the project name on the sidebar to reload the data) to get the correct result to show on the slashbase UI:
image

Maybe we could give an option to the Users to specify which columns need to be returned after doing the INSERTs? Not sure if this might cover columns with default values specified too.

[PostgreSQL]This link cannot be added to slashbase when the database connection name is the same as before

Problem reproduction:

Use slashbase to create a new PostgreSQL link, Display Name: enter the link name, then delete the PostgreSQL link, and then use the same Display Name: name to create a PostgreSQL link. At this time, the link test can pass, but click ADD, Prompt there was some problem

Quick description

If the Display Name item is the same as before (the corresponding PostgreSQL item has been deleted), it cannot be added.

Other

When slashbase deletes a project or database, the corresponding project or database information still remains in the database.

system message:

slashbase:docker ,v0.10.1
PostgreSQL:docker,15.1

Test MongoDB queries

Run the Slashbase app on your local machine, connect to a MongoDB and try running all different kind of queries supported by MongoDB and file a bug in the issues if any query doesn't work.

Test MySQL queries

Run the Slashbase app on your local machine, connect to a MySQL and try running all different kind of queries supported by MySQL and file a bug in the issues if any query doesn't work.

Panic while connecting to MongoDB Atlas database

Tried connecting the cloud database provided by MongoDB in Azure Pune Region.

Database Offering: MongoDB Atlas Free Tier
Provider: MongoDB via Azure
Scheme: mongodb-srv

When tried to connect with mongodb-srv as scheme. I got the following panic message:

This error is not produced when the selected scheme is just mongodb

2023/01/13 15:48:31 [Recovery] 2023/01/13 - 15:48:31 panic recovered:
POST /api/v1/dbconnection/create HTTP/1.1
Host: localhost:22022
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en
Connection: keep-alive
Content-Length: 296
Content-Type: text/json
Origin: http://localhost:3000
Referer: http://localhost:3000/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-site
Sec-Gpc: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36


interface conversion: interface {} is int32, not float64
c:/go/src/runtime/iface.go:262 (0x7ff71867bee9)
        panicdottypeE: panic(&TypeAssertionError{iface, have, want, ""})
X:/Github/slashbase/pkg/queryengines/mongoqueryengine/queryengine.go:367 (0x7ff718cce7e4)
        (*MongoQueryEngine).TestConnection: test := data["data"].([]map[string]interface{})[0]["ok"].(float64)
X:/Github/slashbase/pkg/queryengines/queryengines.go:32 (0x7ff71915417c)
        TestConnection: return mongoQueryEngine.TestConnection(dbConn, config)
X:/Github/slashbase/internal/controllers/dbconnection.go:36 (0x7ff7194a7926)
        DBConnectionController.CreateDBConnection: success := queryengines.TestConnection(dbConn.ToQEConnection(), qemodels.NewQueryConfig(false, nil))
X:/Github/slashbase/internal/handlers/dbconnection.go:34 (0x7ff7194abae9)
        DBConnectionHandlers.CreateDBConnection: dbConn, err := dbConnController.CreateDBConnection(createBody.ProjectID, createBody.Name, createBody.Type, createBody.Scheme, createBody.Host, createBody.Port,
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x7ff71949c681)
        (*Context).Next: c.handlers[c.index](c)
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:99 (0x7ff71949c66c)
        CustomRecoveryWithWriter.func1: c.Next()
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x7ff71949b4fd)
        (*Context).Next: c.handlers[c.index](c)
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:489 (0x7ff71949b185)
        (*Engine).handleHTTPRequest: c.Next()
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 (0x7ff71949ace4)
        (*Engine).ServeHTTP: engine.handleHTTPRequest(c)
c:/go/src/net/http/server.go:2916 (0x7ff718b7bdfa)
        serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
c:/go/src/net/http/server.go:1966 (0x7ff718b76df6)
        (*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
c:/go/src/runtime/asm_amd64.s:1571 (0x7ff7186d5a60)
        goexit: BYTE    $0x90   // NOP

Error on docker image unable to initialize embedded filesystem

Hello,

When i run docker run -p 3000:3000 slashbaseide/slashbase

I have an error and the container stops

Running Slashbase IDE at http://localhost:3000
Type 'help' for more info on cli.
2022/12/23 02:13:50 unable to initialize embedded filesystem: no ID found in the file
2022/12/23 02:13:50 using local filesystem for static assets
slashbase >

Update contributing guidelines.

Please update your contributing guidelines.
There are some issues with the current guidelines.
In the section on setting up the development environment, it is stated that the file at development.env.sample should be copied and pasted as development.env in the root directory of the project. However, in this section on configuring the .env.local file, additional information is provided about updating email and password in the frontend package.
Additionally, in the section on running the project, it is stated that the project will listen on ports 3000 and 3001, but in reality, it only listens on port 22022. Thank you.

Error when creating a new DB connection (MySQL)

Hello.
I'm getting an error when creating a new DB connection.
My suspicion is that the error occurs if there is an exclamation point at the end of the password.

Thank you for creating such a great project.

Unable to connect to MongoDB API in Azure CosmosDB

I created a CosmosDB instance in Azure which uses MongoDB API v4.2. After the resource is created I used the connection details to connect to the instance using Slashbase UI. The connection failing with the error message in the UI - "failed to connect to database".

I think the problem is due to the SSL/TLS connection. Will investigate this in more detail and report it here.

Unable to execute Aggregate query with Lookup

I tried executing the below query from the IDE and it is panicking. The query works fine in Mongo console and when testing with other IDEs.

db.credits.aggregate([{$lookup:{from: "movies", localField: "id", foreignField: "id", as: "results"}}])

Here is the panic output in console.

2023/01/16 18:32:02 [Recovery] 2023/01/16 - 18:32:02 panic recovered:
POST /api/v1/query/run HTTP/1.1
Host: localhost:22022
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en
Connection: keep-alive
Content-Length: 181
Content-Type: text/json
Origin: http://localhost:3000
Referer: http://localhost:3000/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-site
Sec-Gpc: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36


runtime error: index out of range [0] with length 0
c:/go/src/runtime/panic.go:89 (0x7ff6e60a5d7e)
        goPanicIndex: panic(boundsError{x: int64(x), signed: true, y: y, code: boundsIndex})
X:/Github/slashbase/pkg/queryengines/mongoqueryengine/queryengine.go:280 (0x7ff6e66ce0ae)
        (*MongoQueryEngine).RunQuery: Aggregate(context.Background(), queryType.Args[0])
X:/Github/slashbase/pkg/queryengines/queryengines.go:23 (0x7ff6e6b5410e)
        RunQuery: return mongoQueryEngine.RunQuery(dbConn, query, config)
X:/Github/slashbase/internal/controllers/query.go:23 (0x7ff6e6ea8607)
        QueryController.RunQuery: data, err := queryengines.RunQuery(dbConn.ToQEConnection(), query, getQueryConfigsForProjectMember(dbConn))
X:/Github/slashbase/internal/handlers/query.go:25 (0x7ff6e6eadd44)
        QueryHandlers.RunQuery: data, err := queryController.RunQuery(runBody.DBConnectionID, runBody.Query)
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x7ff6e6e9c701)
        (*Context).Next: c.handlers[c.index](c)
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:99 (0x7ff6e6e9c6ec)
        CustomRecoveryWithWriter.func1: c.Next()
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x7ff6e6e9b57d)
        (*Context).Next: c.handlers[c.index](c)
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:489 (0x7ff6e6e9b205)
        (*Engine).handleHTTPRequest: c.Next()
C:/Users/prash/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 (0x7ff6e6e9ad64)
        (*Engine).ServeHTTP: engine.handleHTTPRequest(c)
c:/go/src/net/http/server.go:2916 (0x7ff6e657bdfa)
        serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
c:/go/src/net/http/server.go:1966 (0x7ff6e6576df6)
        (*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
c:/go/src/runtime/asm_amd64.s:1571 (0x7ff6e60d5a60)
        goexit: BYTE    $0x90   // NOP

I found the problem to be in this function mongoutils.IsQueryTypeRead(queryType) where the query.Args is having 0 elements and therefore panicking. I suppress the panic here but when it gets back in the queryengine query conditional checks for queryType then it panics there.

Incorrect docs

Hello!

First of all, it would be great if the docs were editable on Github, either in this repo or another, then this would be a PR instead of an issue. 😄

The URL to the wget command is incorrect, it says slashbase/slashbase instead of slashbaseide/slashbase
image

Console doesn't scroll properly to the bottom

After a command is entered in the console and the commands results in a large table as output, the console displays the output but doesn't scroll properly to the bottom of the console.

Postgresql commands give syntax error in in-app CLI

Expected the \dt command to work from within slashbase in-app CLI. Got a syntax error. 😫
But it's not a syntax error if I use the same command from postgresql's CLI.

image

image

Let me know if more details might be needed.

Thanks!

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.