Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Document major limitations #872

@frioux

Description

@frioux

This is an exciting project and I used it in my test harness for months, till the limitations basically made the situation untenable. At the very least I hope this issue helps people know what this project can and cannot do before they invest a lot of time in it.

Dead?

Sadly, I think all of src-d have stopped pushing to the open source repos. At best they have decided to invest in internal stuff. At worst the company went under six months ago. Keep this in mind along with the other limitations here.

Inscrutable errors

When you accidentally hit an unsupported feature, next steps are super difficult. Here's some code that I'd expect to error due to an unknown table for example:

package main

import (
	"database/sql"
	"fmt"
	
       sqle "github.com/src-d/go-mysql-server"
       "github.com/src-d/go-mysql-server/auth"
       "github.com/src-d/go-mysql-server/memory"
       "github.com/src-d/go-mysql-server/server"

	_ "github.com/go-sql-driver/mysql"
)

func main() {
	engine := sqle.NewDefault()
	engine.AddDatabase(memory.NewDatabase("testing"))

	srv, err := server.NewDefaultServer(server.Config{
		Protocol: "tcp",
		Address:  "127.0.0.1:0",
		Auth:     new(auth.None),
	}, engine)

	go func() {
		err := srv.Start()
		if err != nil {
			// Start always returns nil, never a real error, so this is exceptional
			panic(err)
		}
	}()

	db, err := sql.Open("mysql", "user:password@tcp("+srv.Listener.Addr().String()+")/testdb")
	if err != nil {
		panic(err)
	}

	_, err = db.Query("SELECT * FROM foo WHERE id = ?", 1)
	if err != nil {
		panic(err)
	}
}

The actual error is:

ERRO[0000] Got unhandled packet (default) from client 1 (127.0.0.1:12760), returning error: [22 83 69 76 69 67 84 32 42 32 70 82 79 77 32 102 111 111 32 87 72 69 82 69 32 105 100 32 61 32 63] 
panic: Error 1047: command handling not implemented yet: 22

Again, keep this in mind for some of the unsupported features below.

Poor Concurrency support

The server seems to not support concurrent access very well, choking with inscrutable errors like the above on code that works non-concurrently. This is maybe not a big deal for many, but we tend to run all of our tests with t.Parallel() to shake out concurrency related bugs.

No Auto incrementing value support

You basically cannot use SQL to insert into the database, instead you are forced to use sql.Inserter. This dramatically reduces the usefulness of this project.

No Bindvar Support

If you try to use bind vars (?'s in SQL) this thing will choke on them, so you have to do that client side. This is livable since you can set that flag on the database connection.


I'm sure there's more, but all the above forced me to stop using this. I hope that the community can help pick this back up and give it the love it needs. I would love to pitch in and might, but I assume someone will need to fork it and give it a new home.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions