GithubHelp home page GithubHelp logo

little-brother / sqlite-gui Goto Github PK

View Code? Open in Web Editor NEW
1.0K 1.0K 52.0 41.38 MB

Lightweight SQLite editor for Windows

License: GNU General Public License v2.0

C 92.49% C++ 7.51%
administration database database-management editor extension gui manager sql sqlite sqlite3 tool winapi windows xml

sqlite-gui's People

Contributors

little-brother 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  avatar  avatar  avatar

sqlite-gui's Issues

Chart scroll bar doesn't allow you to grab it

Hi,

You've nicely improved the charting ability in sqlite-gui - thank you very much!

I like that I can scroll the chart downwards and see all data, but the scroll bar on the right doesn't actually allow me to click and drag it.
I can use the mouse wheel to go up and down, but I would expect the ability to click and drag the scroll bar - just like we can on any Windows application.

Please consider allowing the scroll bar to be clicked and dragged.

Thanks!

Error opening database

I tried to open some database and receive this error:

"attached databases must use the same text encoding as main database"

The sabe database was opened in "SQLiteStudio"

Thanks.

Broken UNDO

Minimal example of issue

#define UNICODE
#define _UNICODE

#include <tchar.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <richedit.h>

#define IDC_EDITOR 1000
#define IDC_BUTTON 1001

HWND hEditorWnd;

bool updateHighlighting(HWND hWnd) {
	int carriagePos = 0;
	SendMessage(hWnd, EM_GETSEL, (WPARAM)&carriagePos, (WPARAM)&carriagePos);
	
	CHARFORMAT cf = {0};
	cf.cbSize = sizeof(CHARFORMAT) ;
	cf.dwMask = CFM_COLOR | CFM_BOLD;
	cf.crTextColor = RGB(0, 0, 200);
	cf.dwEffects = CFM_BOLD;
	SendMessage(hWnd, EM_SETSEL, 0, -1);
	SendMessage(hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
	
	cf.dwMask = CFM_COLOR | CFM_BOLD;
	cf.dwEffects = cf.dwEffects & ~CFM_BOLD;
	cf.crTextColor = RGB(200, 0, 0);
	SendMessage(hWnd, EM_SETSEL, 4, 6);
	SendMessage(hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
	SendMessage(hWnd, EM_SETSEL, carriagePos, carriagePos);
	
	_tprintf(TEXT("End highlight\n"));
	return true;
}

LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
	switch (message) {
		case WM_DESTROY:
			PostQuitMessage (0);
		break;
		
		case WM_COMMAND: {
			if (LOWORD(wParam) == IDC_EDITOR && HIWORD(wParam) == EN_CHANGE)
				return updateHighlighting(hEditorWnd);
		
			if (LOWORD(wParam) == IDC_BUTTON && HIWORD(wParam) == BN_CLICKED)
				_tprintf(TEXT("UNDO: can %i => result: %i\n"), Edit_CanUndo(hEditorWnd), Edit_Undo(hEditorWnd));
		}
		break;
		
		default:
			return DefWindowProc (hwnd, message, wParam, lParam);
	}
	
	return 0;
}

int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow) {
	InitCommonControls();
	LoadLibrary(TEXT("msftedit.dll"));
	
	HWND hwnd;
	MSG msg;
	WNDCLASSEX wincl;
	
	wincl.hInstance = hThisInstance;
	wincl.lpszClassName = TEXT("AppClass");
	wincl.lpfnWndProc = WindowProcedure;
	wincl.style = CS_DBLCLKS;
	wincl.cbSize = sizeof (WNDCLASSEX);
	wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
	wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
	wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
	wincl.lpszMenuName = NULL;
	wincl.cbClsExtra = 0;
	wincl.cbWndExtra = 0;
	wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
	
	if (!RegisterClassEx (&wincl))
		return 0;
	
	hwnd = CreateWindowEx (0, TEXT("AppClass"), TEXT("Test"), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 300, 400, 310, 375, HWND_DESKTOP, NULL, hThisInstance, NULL);
	
	CreateWindowEx(0, WC_BUTTON , L"UNDO", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 10, 310, 280, 30, hwnd, (HMENU)IDC_BUTTON, hThisInstance,  NULL);
	hEditorWnd = CreateWindowEx(0, TEXT("RICHEDIT50W") , NULL, WS_VISIBLE | WS_CHILD | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP | ES_NOHIDESEL, 0, 0, 300, 300, hwnd, (HMENU)IDC_EDITOR, hThisInstance,  NULL);
	SendMessage(hEditorWnd, EM_SETEVENTMASK, 0, ENM_CHANGE | ENM_UPDATE | ENM_KEYEVENTS);
	
	while (GetMessage (&msg, NULL, 0, 0)) {
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
	
	return msg.wParam;
}

Editor pane not refreshing fast when updating text

Hi,

This may need more experimenting and investigating on your part, because I'm not exactly certain what I'm seeing is related.

It seems saving a query (maybe multiple saves) cause the editor pane to become sluggish and doesn't update to edit/view the query.
The app never crashes or becomes unresponsive, but the editor pane doesn't refresh allowing you to see the text very well.

Thanks!

Format queries in editor

Hi,

Sometimes we can be a little sloppy when writing out a query.

It would be neat if sqlite-gui could format queries, so that when we save them, they're saved formatted already.

Thanks!

Copy column names from tree

Hi,

Sometimes I don't want to type the column names that I'm interested in querying from. It would be nice if I could copy the column name with ctrl+c and paste it into the editor window.

This is mostly working, but it will also copy over the datatype, so that has to be deleted as well.

For example, EventCode: TEXT It would be nice if it would just copy EventCode, then I copy paste that into the editor/terminal.

alternatively, is it possible for auto complete to look at column names?

Thanks!

Thank you!

Hello,

I wanted to thank you for working with me on all the bug reports. You response to the issues has been outstanding and I appreciate your willingness to continue improving sqlite-gui.

You're doing a great job and this tool has improved greatly from when I first started using it - which is all the way back in September 2020!

Keep up the great work.

Best,
j.b.

Saved queries can't be deleted

Hi,

I like the saved query feature. If I'm working on something complex, I would want to save it often to make sure I don't lose my work.

However, it doesn't seem like I can delete a query within the GUI, with something like a right-click, or shift right-click.

The saved queries can probably be deleted directly in the prefs.sqlite, but it would be nice to see a GUI option for deletion.

Thanks!

Overwrite file doesn't reprompt

Hi,

You fixed an issue in #27, where an existing file is overwritten with a new save - good job!

However, the UI experience isn't what most other apps do. Other apps would give the user the ability to rename the file if they don't want to replace it.

This is an example of how gnuplot does it:

[Window Title]
Confirm Save As

[Content]
year2020-weather.png already exists.
Do you want to replace it?

[Yes] [No]

If user chooses no, the export window is still open and they can rename it.

In sqlite-gui, the user has to choose to export the data again.

Table names present with auto complete

Hi,

When a database was opened and then closed, auto complete can look at the table names.

  1. Open sqlite-gui.1.5.4
  2. Open database bookstore.sqlite
  3. Run simple query
  4. Close database with close button
  5. Type select * from and notice tables appear in the drop down menu

I wouldn't expect table names to be present, since the database was closed.

Thanks!

Encrypted database kept active

Hi,

If I open an unencrypted database, encrypted it, close it, and reopen it, I can read the data without a password prompt.

  1. Open sqlite-gui
  2. Open a database
  3. Database > set encryption
  4. Use default password and type in password
  5. Click ok
  6. Don't backup database
  7. Notice SQL logo changes to cyan color
  8. Close database but keep sqlite-gui open
  9. Open same database you used in step 2
  10. Notice there is no password prompt and the sqlite-gui icon changed to cyan color

I think this is another instance where the database is kept open/in memory, even though sqlite-gui shows it closed.

Thanks!

Have saved query open new editor

Hi,

For your consideration...

When an editor is already opened and has text in the editor, running a saved query will put the text in the same open editor. If you run the two different queries, you get two different results tabs, which is neat, but I would rather have a saved query put the text in a new editor.

Directory held active after closing database

Hi,

Similar issues:
#48, #37, #18

  1. Open sqlite-gui
  2. Open database
  3. Execute query
  4. Close database
  5. Delete database from directory
  6. Go up a directory to where the database was store
  7. Attempt to delete the directory
  8. Notice Windows will say the directory is in use and you cannot delete it
  9. Close sqlite-gui
  10. Attempt to delete the directory that you attempted to delete in step 8
  11. Notice you are now able to delete the directory

I would expect to be able to delete the directory my database was in, because the database has been closed and itself has been deleted.

thanks!

Editor tabs still holding on to database

Hi,

Similar to #18

Something in sqlite-gui is still holding on to the database after it's closed in the app. As a result, I can't delete or rename my database file. I haven't yet tracked down what's causing this.

Clear terminal view

Hi,

I like the terminal view for the results, since it also shows the query.

However, there doesn't seem to be a way to clear the data out. If I open one DB, use the terminal to execute some queries, then close and open another database, the old data is still present in the terminal.

I would request a way to clear the screen/buffer in the terminal view.

Thanks!

Can't ctrl+backspace to delete editor name

Hi,

In all GUI applications I use, I can press ctrl+backspace to delete the word behind the cursor.

With sqlite-gui, double-clicking an editor allows you to rename it, but ctrl+backspace doesn't delete the text. Instead some weird character is put there.

Please consider supporting ctrl+backspace to rename tabs.

Thanks!

Save queries on exit prompt

Hi,

If I have a few tabs open and I close the squlite-gui app, there is no prompt to save the queries. (yes/no prompt)

You may want to consider a prompt for the user to save the queries.

Maybe this only needs to be prompted when "Restore editor tabs at startup" is unchecked.

Thanks!

Import schema file and save DB

Hi,

You implemented a nice feature in #9 - an in memory database. Thank you for putting that in your tool.

I can create an in memory DB, then import a sql file under Tools > Import SQL File, but I don't see a way where I can save my database after it's been imported.

Would you please consider the ability to convert an in memory DB to disk? That way the DB file can be opened again later.

Thanks!

Print line number with error

Hi,

To be considered if you implement #22....

When there is an error in the editor, the results pane says there's an error. It could also include the line number with the error.

Thanks!

Double-click broken for text in 'single quotes'

Hi,

Using sqlite-gui, the editor seems broken when you try to double-click text in single quotes.

Type

'hello'

in the editor and double-click hello. You'll notice you cannot, it will select the single quote on the right.

I would expect double clicking to function when there are single quotes around a word.

Copy/paste to include header request

Hi,

I like that you can save the results from a query as a csv file and it includes the header.

This is a request to have the the header present when you copy to the clipboard.

This is copy/paste and notice there is no header... :(

1,Steelheart,Brandon Sanderson,978-0385743563,5.0,3
2,All Our Yesterdays,Cristin Terrill,978-1423176374,7.3,10
3,Life After Life,Jill McCorkle,978-1616203221,2.82,4
4,Life After Life,Kate Atkinson,978-0316176491,8.1,5
5,Foundation,Isaac Asimov,978-0553293357,12.7,8

Alternatively, maybe there can be a right-click option to copy data with header.

Thanks!

Auto complete column names

Hi,

Similar to #47...

Is it possible to auto complete the column names while typing the name out?

SQL Server seems to support this.

Thanks!

F5 not always updating tree view

Hi,

It looks like the navigation tree isn't updating after an index is created.

create index
idx_books on books(isbn)

Press F9 to execute
Press F5 to refresh view

Sometimes the index isn't listed under indexes, but if you right-click and select refresh, it will show up.

Export chart to PNG

Hello,

Another chart option...

I don't see a way to export a chart as a PNG or JPG image. Could you please have an option to right-click, or something, to save the image?

Additionally, if there's too much data, you can see all the results.

Using my schema from #11, it looks like if I have a results with something more than a handful, the chart won't be show completely.

INSERT INTO "test" VALUES('2021-05-03',18,40);
INSERT INTO "test" VALUES('2021-05-03',12,67);
INSERT INTO "test" VALUES('2021-05-03',18,84);
INSERT INTO "test" VALUES('2021-05-04',24,56);
INSERT INTO "test" VALUES('2021-05-04',12,65);
INSERT INTO "test" VALUES('2021-05-05',12,9);
INSERT INTO "test" VALUES('2021-05-05',24,16);
INSERT INTO "test" VALUES('2021-05-05',12,69);
INSERT INTO "test" VALUES('2021-05-05',12,9);
INSERT INTO "test" VALUES('2021-05-06',24,17);
INSERT INTO "test" VALUES('2021-05-07',12,32);
INSERT INTO "test" VALUES('2021-05-07',18,46);
INSERT INTO "test" VALUES('2021-05-07',18,72);
INSERT INTO "test" VALUES('2021-05-08',12,51);
INSERT INTO "test" VALUES('2021-05-08',12,74);
INSERT INTO "test" VALUES('2021-05-08',18,98);
INSERT INTO "test" VALUES('2021-05-09',12,60);
INSERT INTO "test" VALUES('2021-05-09',18,99);
INSERT INTO "test" VALUES('2021-05-10',12,7);
INSERT INTO "test" VALUES('2021-05-10',12,10);

Can't ctrl+a in editor tab names

Hi,

ctrl+a does not highlight all text in an editor tab when you're trying to rename it.

  1. Open sqlite-gui
  2. Double click tab name
  3. Notice you're in edit mode
  4. Press ctrl+a and notice the text is not highlighted

In #20 you enhanced the ability to use ctrl+a in many places, so this would further improve sqlite-gui,

Thanks!

Delete all history

Hi,

The query history cannot be deleted all at once. You must select individual queries to delete. Pressing and holding the del key works, but it's time consuming.

I would expect ctrl+a to work here, ctrl+click, and/or shift+click to allow multiple lines to be deleted together.

Thanks!

Paste text as pain text

Hi,

Sometimes I need to use MS Excel to open a file and extract info from it. When I paste it in sqlite-gui, I would expect it to paste as a plain text file. Instead, it's carrying over the formatting from MS Excel. That's not needed.

Please consider allowing pasting as plain text.

Thanks!

Option to include rowid

Hi,

Something for you to consider as a new setting...

Maybe an option to show the rowID when browsing the data checkbox could be added.

DB4S has an option to show the rowID if you right-click on the header when browsing the data. You don't see the rowID if your query doesn't have it.

thanks!

"pragma journal_mode = delete" returns "database is locked"

SQLite connection have to use WAL mode (by default - delete) to allow to execute multiply writable (e.g. update or delete) queries.

Unlike other pragmas, this one changes the database file and attached databases too. If mode was changed to wall by pragma journal_mode = wal early, then pragma journal_mode = delete falls with database is locked. This could be happen because prefs.sqlite (always attached as preferences) also changed mode to wal.

The mode can be changed for each base independently using schema:

pragma main.journal_mode = wal

But it also returns database is locked. Another applications change the journal mode without error.

In memory database?

Hello,

How can I create an in memory database using sqlite-gui? If no database is open, I cannot execute a query.

Thanks!

Terminal view broken when closing tabs at startup

Hi,

If you uncheck Restore editor tabs at startup (default is checked), the terminal view text is black and you can't read it unless you highlight the text.

  1. Open app
  2. Database > Settings
  3. Uncheck Restore editor tabs at startup
  4. Click ok
  5. Go to terminal editor and type .help
  6. Execute
  7. Notice you can see text
  8. Open a few blank editors
  9. Close app
  10. Open app
  11. Notice extra editor tabs are dismissed (as expected)
  12. Go to terminal editor and type .help
  13. Execute
  14. Notice you cannot see the text

I would expect to always see the text.

Thanks!

p.s. you probably want to change at to on:
Restore editor tabs ON startup

Database comparison broken

Hi,

I don't know what the database comparison does under tools, but it doesn't seem to do anything useful.

  1. Open sqlite-gui with the bookstore database
  2. Go to tool > database comparison
  3. Choose any other database.
  4. Notice this message:
---------------------------
Info
---------------------------
No differences found
---------------------------
OK   
---------------------------

How could there not be any differences between the two unique databases? The compare schema option seems to work fine.

Cancel in view doesn't cancel view

Hi,

I found an issue when trying to close the edit view window.

  1. Open sqlite-gui-1.5.1
  2. Open a database with a view
  3. Right-click the view
  4. Click edit
  5. Click cancel
  6. Notice the window closes
  7. Click Close in the menu bar of sqlite-gui-1.5.51
  8. Notice the error message appears:

Info

There are open dialogs. You should close them.

OK

You cannot close the app, even if you edit the view again and execute the view.
I had to use task manager to kill the app.

I would expect the app cancel button to function properly.

Append file extension based on option selected

Hi,

I think export option in sqlite-gui should automatically append the file extension to the file name.

In this example, the file name doesn't have .csv appended to it.

  1. Open tool
  2. Open database
  3. Run query
  4. Select results
  5. Right-click and choose "export to csv"
  6. Type in file name
  7. Click save
  8. Review file in Windows Explorer and notice file name does not have extension

I would expect the file extension present on the export.

Also, Tools > Export as CSV file doesn't append the file extension to the file that's exported.

It looks like .sql is also absent when exporting files.

Appending file extensions is a standard Windows behavior when saving files.

Thanks!

Add button and shortcut to comment/uncomment lines

Hi,

Please consider adding a button in the toolbar to comment/uncomment lines in squlie-gui.
The user can of course type -- themselves, but having a button available would be a nice feature to have.

DBBS uses ctrl+/ as a shortcut to comment/uncomment. Maybe you can use the same?

Chart improvement ideas

Hi,

I like the chart option that's built into the tool - so neat. Thank you for adding this in.

However, sometimes the query requests need to have more data than makes sense on a chart.
I would like an option to select columns to chart and maybe specify if it will be on X or Y column.

For instance, this data doesn't make any sense in the chart:

schema:

CREATE TABLE IF NOT EXISTS "test" (
"date" ,
"number" ,
"eventCode"
);

data:

INSERT INTO "test" VALUES('2021-05-03',18,40);
INSERT INTO "test" VALUES('2021-05-03',12,67);
INSERT INTO "test" VALUES('2021-05-03',18,84);
INSERT INTO "test" VALUES('2021-05-04',24,56);
INSERT INTO "test" VALUES('2021-05-04',12,65);
INSERT INTO "test" VALUES('2021-05-05',12,9);
INSERT INTO "test" VALUES('2021-05-05',24,16);
INSERT INTO "test" VALUES('2021-05-05',12,69);
INSERT INTO "test" VALUES('2021-05-05',12,9);
INSERT INTO "test" VALUES('2021-05-06',24,17);

Maybe I need to show all three columns in the results, but only need to have date and eventcode on the chart.

Right now all three are present and doesn't really represent anything useful.

Thanks for the consideration!

Export to csv doesn't prompt to replace file

Hi,

If I export a csv file from a query, I can choose the same name without any warning the file exists and it will be replaced.

I would expect some kind of prompt to say yes/no for replacing file with new data. This is a standard behavior across windows.

Thanks!

Database not released from app after close

Hi,

In sqlite-gui.1.5.1, if I open a database, work on it, then close it, sqlite-gui.1.5.1 still holds on to the database. As a result, I can't rename the database file.

  1. Open sqlite-gui.1.5.1
  2. Open a database in sqlite-gui.1.5.1
  3. Run simple query so you know DB is open & active
  4. Close DB
  5. Rename the db file
  6. Notice Windows will tell you it's in use

I would expect that the database would be released once the application closes the file.

Thanks!

Make ctrl+A work in viewer

Hi,

I like the data viewer window you have in the app when you double-click on the column name. The where filter is also nice.

Could you please consider having ctrl+a work as a highlight all in the where filter and in all the filters below the column names?

ctrl+A is a standard behavior in almost anything involving text.

Thanks!

Right-click export to csv doesn't copy header

Hi,

If I have some results that I want to export, I can right-click and choose export to csv.

The minor issues is, the header isn't apart of the data that's exported. By default, I would expect the header to be present.

Thanks!

Put version# somewhere in app

Hi,

Please consider adding the version number of your application somewhere.

Typically this is found under the about tab. Maybe it would be nice to also have the SQLite3 version loaded with the app as well.

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.