Giter Club home page Giter Club logo

termdbms's People

Contributors

alphatroya avatar mathaou avatar meowgorithm 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

termdbms's Issues

Alpha 1.0 Release (Database Agnostic Spreadsheet Program)

I've realized that I could turn the program into a database agnostic fully fledged spreadsheet program with about a months worth of work. Any features you'd like? Here's what I have planned:

  • Edit cell
  • Add row below/above
  • Remove row below/above
  • Add column left/right
  • Remove column/right
  • Macros? Need to think about which functions would be most helpful in which circumstances. Currency conversion or something maybe.
  • Cell highlight/coloring
  • Expand column to fill screen
  • Serialize (this is going to be the hardest part because it's different for every database)
  • Copy/paste (going to also be tricky to implement

That's all for Alpha 1.0 release

Need to think about input. I need text and dialog boxes, maybe some more fancy stuff, but having mouse / keyboard support for all of this is maybe kind of cluttered so maybe some kind of vim-esque structuring idk

PRs related to this effort welcome and suggestions / feedback appreciated!

Publish a Homebrew package

This app is awesome and you are awesome for making and sharing it. Have you already started on a package for Homebrew? Happy to help contribute if not

Missing quoting when tables have "special" names

I have a database with a table called transaction. Opening it view the viewer:

panic: SQL logic error: near "transaction": syntax error (1)

goroutine 1 [running]:
sqlite3-viewer/viewer.(*TuiModel).SetModel(0x987d60, 0x0, 0xc0000142c6)
        termdbms/viewer/events.go:171 +0x765
main.main()
        termdbms/main.go:113 +0x4e5

Probably only a missing quoting somewhere...

Schema is:

CREATE TABLE `transaction` (
        id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
        sheetId INTEGER NOT NULL,
        transactionId INTEGER NOT NULL,
        lineno INTEGER NOT NULL,
        lineId INTEGER NOT NULL REFERENCES line(id)
);

runtime error: integer divide by zero

Hi @mathaou
Congrat for this project, I wanted to test because I like terminal based tools.

However, I cannot start sqlite3-viewer :

Caught panic:

runtime error: integer divide by zero

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack(0x4d, 0x0, 0x0)
	/usr/local/go/src/runtime/debug/stack.go:24 +0x9f
runtime/debug.PrintStack()
	/usr/local/go/src/runtime/debug/stack.go:16 +0x25
github.com/charmbracelet/bubbletea.(*Program).Start.func2(0xc00017c1b0)
	/home/pierre/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:447 +0xd6
panic(0x71fa60, 0x9937c0)
	/usr/local/go/src/runtime/panic.go:965 +0x1b9
sqlite3-viewer/viewer.(*TuiModel).CellWidth(...)
	/tmp/app/demo/sqlite-tui/viewer/util.go:33
sqlite3-viewer/viewer.(*TuiModel).GetBaseStyle(0xc000131bb0, 0x6e7db1, 0xc00000c0a8, 0x0)
	/tmp/app/demo/sqlite-tui/viewer/util.go:39 +0x86f
sqlite3-viewer/viewer.handleWidowSizeEvents(0xc000131bb0, 0xc000131810)
	/tmp/app/demo/sqlite-tui/viewer/events.go:39 +0xae
sqlite3-viewer/viewer.TuiModel.Update(0xc00015d0b0, 0xc00015d0e0, 0xc00015d110, 0x7, 0x1, 0x110, 0x44, 0x0, 0x3, 0x0, ...)
	/tmp/app/demo/sqlite-tui/viewer/viewer.go:55 +0xd46
github.com/charmbracelet/bubbletea.(*Program).Start(0xc00017c1b0, 0x0, 0x0)
	/home/pierre/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:589 +0x5b9
main.main()
	/tmp/app/demo/sqlite-tui/main.go:111 +0x39d

Setup :

  • debian 10
  • go 1.16
  • xterm 256 activated

Is there something that I missed?

Large (multi-gb) sqlite db support

This looks neat but it takes several minutes to open a 10 GB sqlite file containing 40 million rows.

It does eventually render the interface, but it's taking 38 GB memory according to macOS Activity Monitor.

DB Browser for SQLite is able to work with this DB without loading the entire DB into memory (it's consuming 800 MB RAM).

Loading the entire DB into memory would be OK if it's done in a more memory-efficient way (my system could handle taking 1.5x the size of the sqlite db file but not 3.8x)

Once the interface loaded, I got this crash when I pressed a button:


panic: runtime error: slice bounds out of range [1450:61]-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------┤ 1450, 0

goroutine 561 [running]:
github.com/mathaou/termdbms/viewer.DisplaySelection(0xc203347600)
	/Users/hubert/go/pkg/mod/github.com/mathaou/[email protected]/viewer/ui.go:250 +0x5f3
github.com/mathaou/termdbms/viewer.AssembleTable(0xc203347600?)
	/Users/hubert/go/pkg/mod/github.com/mathaou/[email protected]/viewer/tableutil.go:18 +0x7b
github.com/mathaou/termdbms/viewer.TuiModel.View.func1(0xc203e34880)
	/Users/hubert/go/pkg/mod/github.com/mathaou/[email protected]/viewer/viewer.go:152 +0x2e
created by github.com/mathaou/termdbms/viewer.TuiModel.View
	/Users/hubert/go/pkg/mod/github.com/mathaou/[email protected]/viewer/viewer.go:151 +0x219

Build failes due to "imported and not used" error

go build does not build project due to following error:

# sqlite3-viewer/viewer viewer/viewer.go:8:2: imported and not used: "github.com/mattn/go-runewidth" as runewidth

Removing this import from code fixes issue and build finishes successfuly.

libsql support (turso)

hello! do you think this could add libsql support so one can use turso? it behaves like sqlite driver (mostly) i think you need to include an import and then allow the user to pass 'libsql' as the driver. it works with sqlite drivers, i think the ones you already use.

https://github.com/tursodatabase/libsql-client-go#readme

Installation
Install the driver into your module:

go get github.com/tursodatabase/libsql-client-go

Import the driver into your code using a blank import:

import (
	_ "github.com/tursodatabase/libsql-client-go/libsql"
)

Ensure all the module requirements are up to date:

go mod tidy

Add support for sqlite3 database files

Crash on DB with many columns?

ts.sqlite.zip

If I open this file and press down arrow twice I get a crash:

panic: runtime error: slice bounds out of range [:-1]                                                                                                                                                                                                                                                                                                                                                                             

goroutine 43 [running]:
sqlite3-viewer/viewer.TruncateIfApplicable(0xc000896340, {0xc00001e680, 0x7})
	~/go/tuitty/viewer/util.go:99 +0x192
sqlite3-viewer/viewer.TuiModel.View.func2(0xc00059c070)
	~/go/tuitty/viewer/viewer.go:121 +0xae5
created by sqlite3-viewer/viewer.TuiModel.View
	~/go/tuitty/viewer/viewer.go:106 +0x272

Fails to build with 32-bit Go

This error when trying to build with 32-bit version of Go.

# sqlite3-viewer/viewer
viewer\util.go:269:22: constant 9223372036854775807 overflows int
viewer\util.go:274:22: constant 9223372036854775807 overflows int
viewer\viewer.go:8:2: imported and not used: "github.com/mattn/go-runewidth" as runewidth

Builds OK (after removing the unused import) with 64-bit Go.

(Also, I'm on Win7, and the terminal codes do not work with ANSI.)

No installation instructions + getting started

I apologize if this is obvious to Go progammers - but how would one go about installing this on ubuntu (wsl2) with a fresh golang install?

As for getting started instructions, what is the shell command to use it?

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.