miniSql

创建
zgc123@gmail.com authored at 11/19/2023 1:40:15 AM
6136600
Tree
0 Parent(s)
Summary: 10 changed files with 260 additions and 0 deletions.
Added +34 -0
Added +20 -0
Added +36 -0
Added +119 -0
Added +0 -0
Added +0 -0
Added +0 -0
Added +0 -0
Added +37 -0
Added +14 -0
Added +34 -0
diff --git a/minisqlquery-master/src/Docs/Adding a MSSQL Connection.md b/minisqlquery-master/src/Docs/Adding a MSSQL Connection.md
new file mode 100644
index 0000000..c642708
--- /dev/null
+++ b/minisqlquery-master/src/Docs/Adding a MSSQL Connection.md
@@ -0,0 +1,34 @@
+Adding a MSSQL Connection
+=========================
+
+Click *Add*.
+
+Select a Provider, in this example I am leaving it as “System.Data.SqlClient”.
+
+Enter a *Name* for the connection, e.g. “Adventure Works (local)”.
+
+Set the Connection Strings “Integrated Security” value to “True”.
+
+Set the Connection Strings “Data source” value to “localhost” (or “localhost\SQLEXPRESS” as required.)
+
+Set the Connection Strings “Initial Catalog” either by using the dropdown or typing name straight in. 
+
+***Note***
+
+The dropdown will only work if the connection details are sufficient to query the datasource at the time, e.g. Integrated Security=True will typically suffice depending on your environment.
+
+You can use the *"Test..."* button to confirm the connectivity.
+ 
+Press *OK* and you will return to the “Database Connection List Editor” and you will see the new item in the list. Press *OK* here to return to Mini SQL Query.
+ 
+Next select the new connection definition from the dropdown list on the toolbar. The application will pause while it loads the database schema information. Now you can explore the schema using the tree of database objects on the left. Keep in mind the “mini” in Mini SQL Query, the list of objects is by no means exhaustive! Currently the essentials such as tables, views and their associated column information are loaded. Depending on the provider foreign key information is also loaded.
+ 
+Note – Foreign Keys
+-------------------
+The core schema engine is generic for all ADO.NET providers. The only thing not discoverable by the generic engine is the foreign key relationships. To retrieve foreign key information from a database, a provider specific implementation is required; currently there are two, Microsoft SQL Server and Microsoft’s SQL Server Compact Edition. These are typically driven by demand. Patches accepted!
+
+Note – Tables and Views Only
+----------------------------
+Currently only table and view information is retrieved from the databases schema. Again, this is driven by demand. The number of times access to stored procedures has been too low to warrant implementation. Patches accepted!
+
+[Quickstart](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Quickstart.md)
Added +20 -0
diff --git a/minisqlquery-master/src/Docs/Adding an SQLite Connection.md b/minisqlquery-master/src/Docs/Adding an SQLite Connection.md
new file mode 100644
index 0000000..2481cbe
--- /dev/null
+++ b/minisqlquery-master/src/Docs/Adding an SQLite Connection.md
@@ -0,0 +1,20 @@
+Adding an SQLite Connection
+===========================
+
+Click *Add*.
+
+Select an SQLite Provider, in this example I am leaving it as "System.Data.SQLite" (http://sqlite.org/).
+
+Enter a *Name* for the connection, e.g. "SQLite Example".
+
+Set the “Data source” value to the SQLite filename, if it does not exist the SQLite provider will create it.
+
+![Add SQLite connection](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Mini-SQL-Query--Edit-Connection-Strings--Add-SQLite-connection.png)
+
+You can use the *"Test..."* button to confirm the connectivity.
+
+See the [http://system.data.sqlite.org/index.html/doc/trunk/www/faq.wiki](http://system.data.sqlite.org/index.html/doc/trunk/www/faq.wiki) site for more detailed information on this provider.
+ 
+Press *OK* and you will return to the “Database Connection List Editor” and you will see the new item in the list. Press *OK* here to return to Mini SQL Query.
+
+[Quickstart](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Quickstart.md)
Added +36 -0
diff --git a/minisqlquery-master/src/Docs/Basic Usage.md b/minisqlquery-master/src/Docs/Basic Usage.md
new file mode 100644
index 0000000..ae97a47
--- /dev/null
+++ b/minisqlquery-master/src/Docs/Basic Usage.md
@@ -0,0 +1,36 @@
+Basic Usage
+===========
+
+Below is a list of typical usage scenarios with Mini SQL Query. 
+
+Some Shortcuts
+--------------
+
+Mini SQL Query uses the typical editor key shortcuts for cut, copy, paste etc. 
+
+
+**ActionKey** / **Combination**
+
+**New window**	Control + N
+
+**New File** (then select type, txt, sql etc)	Control + Alt + N
+
+**Open**	Control + O
+
+**Save**	Control + S
+
+**Go to line**	Control + G
+
+**Execute**	F5
+
+**View table**	Control + T
+
+**Cut	Control** + X
+
+**Copy**	Control + C
+
+**Paste**	Control + V
+
+**Comment block (language specific)**	Control + /
+
+[Quickstart](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Quickstart.md)
Added +119 -0
diff --git a/minisqlquery-master/src/Docs/Context Menu Commands.md b/minisqlquery-master/src/Docs/Context Menu Commands.md
new file mode 100644
index 0000000..cd10ff2
--- /dev/null
+++ b/minisqlquery-master/src/Docs/Context Menu Commands.md
@@ -0,0 +1,119 @@
+Context Menu Commands
+=====================
+
+Following is a brief explanation of the commands available on the context menu of the DB Inspector.
+
+View Table Data
+---------------
+
+To view the contents of a table, either:
+
+- Right-click the name of the table in the DB Inspector and select *View table data*
+- From the *Plugins* menu, select *View table... (Ctrl+T)* and then choose a table name from the dropdown list or type it in. 
+
+Use *F5* to refresh or click the “Reload Table” link button.
+
+Below is an example of data loaded by the tool. The date format can be modified via the *Edit - Options* menu item.
+ 
+*NOTE – Exporting Data*
+
+An interesting addition here is the “Export Script...” link. It will convert the contents of the window into insert statements. By default it will observe _identity_ or _timestamp_ columns for example and not add those columns to the insert statements. If you want these values output the option can be changed. This can be very useful with setting up test data for example. With respect to MSSQL the “SET IDENTITY_INSERT <tablename> ON” command can be used to insert the data.
+
+Generate Select Statement
+-------------------------
+
+Make sure you have an active edit window in focus (Control+N) and right click a table and select “Generate Select Statement”. SQL code similar to below will be generated.
+
+    SELECT
+    	JobCandidateID,
+    	EmployeeID,
+    	Resume,
+    	ModifiedDate
+    FROM HumanResources.JobCandidate
+    
+Generate Select COUNT(*) Statement
+----------------------------------
+
+No prize for guessing what this does. Make sure you have an active edit window in focus (Control+N) and right click a table and select “Generate Select COUNT(*) Statement”. SQL code similar to below will be generated. 
+
+    SELECT COUNT(*) FROM HumanResources.EmployeeAddress
+
+Generate Insert Statement
+-------------------------
+
+Make sure you have an active edit window in focus (Control+N) and right click a table and select “Generate Insert Statement”. SQL code similar to below will be generated. 
+When an insert statement is generated the tables’ schema is used to ignore columns that are “read-only”. Examples are identity or timestamp columns. Also note the default values and comments to assist filling out the statement. The default for a GUID column is an empty GUID, if you need a new one generated use the “Insert GUID” menu item from the Plugins menu. Dates are a bit of a can of worms so I opted for a question mark (sorry!)
+
+	INSERT INTO HumanResources.Employee
+		(NationalIDNumber,
+		ContactID,
+		LoginID,
+		ManagerID,
+		Title,
+		BirthDate,
+		MaritalStatus,
+		Gender,
+		HireDate,
+		SalariedFlag,
+		VacationHours,
+		SickLeaveHours,
+		CurrentFlag,
+		rowguid,
+		ModifiedDate)
+	VALUES
+		(N'' /*NationalIDNumber,nvarchar(15)*/,
+		0 /*ContactID,int*/,
+		N'' /*LoginID,nvarchar(256)*/,
+		null /*ManagerID,int*/,
+		N'' /*Title,nvarchar(50)*/,
+		'?' /*BirthDate,datetime*/,
+		N'' /*MaritalStatus,nchar(1)*/,
+		N'' /*Gender,nchar(1)*/,
+		'?' /*HireDate,datetime*/,
+		0 /*SalariedFlag,bit*/,
+		0 /*VacationHours,smallint*/,
+		0 /*SickLeaveHours,smallint*/,
+		0 /*CurrentFlag,bit*/,
+		'00000000-0000-0000-0000-000000000000' /*rowguid,uniqueidentifier*/,
+		'?' /*ModifiedDate,datetime*/)
+
+Generate Update Statement
+-------------------------
+
+Make sure you have an active edit window in focus (Control+N) and right click a table and select “Generate Update Statement”. SQL code similar to below will be generated. 
+As with the insert statement generation, the tables’ schema is used to ignore columns that are “read-only”. Also, the primary key columns go into the where clause with comments to assist.
+
+	UPDATE HumanResources.EmployeeDepartmentHistory
+	SET
+		EndDate = null,
+		ModifiedDate = '?'
+	WHERE
+		EmployeeID =  /*value:EmployeeID,int*/ AND
+		DepartmentID =  /*value:DepartmentID,smallint*/ AND
+		ShiftID =  /*value:ShiftID,tinyint*/ AND
+		StartDate = /*value:StartDate,datetime*/
+
+Generate Delete Statement
+-------------------------
+
+Make sure you have an active edit window in focus (Control+N) and right click a table and select “Generate Delete Statement”. SQL code similar to below will be generated. 
+As with the update statement generation, the tables’ schema is used to create a where clause with the primary key columns.
+
+	DELETE FROM
+		HumanResources.Department
+	WHERE
+		DepartmentID = /*value:DepartmentID*/
+
+Copy Table Name
+---------------
+
+This command copies the fully qualified table name to the windows clipboard.
+
+Truncate Table
+--------------
+
+This command deletes all the rows from the selected table. The truncate statement is not actually used currently due to the requirements (no foreign keys) and cross database support so in essence the resulting command is just “DELETE FROM *table*”. Patches welcome!
+
+The truncate table command also sends an application level message so that if you are viewing a table with the view data command, the contents of that window is refreshed.
+
+[Quickstart](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Quickstart.md)
Added +0 -0
diff --git a/minisqlquery-master/src/Docs/Mini-SQL-Query.png b/minisqlquery-master/src/Docs/Mini-SQL-Query.png
new file mode 100644
index 0000000..415923f
Binary files /dev/null and b/minisqlquery-master/src/Docs/Mini-SQL-Query.png differ
Added +0 -0
diff --git a/minisqlquery-master/src/Docs/Mini-SQL-Query--AdventureWorks.png b/minisqlquery-master/src/Docs/Mini-SQL-Query--AdventureWorks.png
new file mode 100644
index 0000000..0bc1d21
Binary files /dev/null and b/minisqlquery-master/src/Docs/Mini-SQL-Query--AdventureWorks.png differ
Added +0 -0
diff --git a/minisqlquery-master/src/Docs/Mini-SQL-Query--Edit-Connection-Strings.png b/minisqlquery-master/src/Docs/Mini-SQL-Query--Edit-Connection-Strings.png
new file mode 100644
index 0000000..f09158b
Binary files /dev/null and b/minisqlquery-master/src/Docs/Mini-SQL-Query--Edit-Connection-Strings.png differ
Added +0 -0
diff --git a/minisqlquery-master/src/Docs/Mini-SQL-Query--Edit-Connection-Strings--Add-SQLite-connection.png b/minisqlquery-master/src/Docs/Mini-SQL-Query--Edit-Connection-Strings--Add-SQLite-connection.png
new file mode 100644
index 0000000..76c7fab
Binary files /dev/null and b/minisqlquery-master/src/Docs/Mini-SQL-Query--Edit-Connection-Strings--Add-SQLite-connection.png differ
Added +37 -0
diff --git a/minisqlquery-master/src/Docs/Quickstart.md b/minisqlquery-master/src/Docs/Quickstart.md
new file mode 100644
index 0000000..13ea3cd
--- /dev/null
+++ b/minisqlquery-master/src/Docs/Quickstart.md
@@ -0,0 +1,37 @@
+Mini SQL Query Quick Start
+=================
+
+This document is a quick overview of how to use **Mini SQL Query**.
+
+**Mini SQL Query** from is a minimalist SQL query tool for multiple providers (MSSQL, Oracle, OLEDB, MS Access, SQLite etc). The goal of the Mini SQL Query tool is to allow a developer or trouble-shooter to quickly diagnose issues or make changes to a database using a tool with a small footprint, is portable, fast, flexible and easy to use.
+
+Mini SQL Query is "deliberately minimalist". Software too often becomes bloated and less usable while trying to satisfy the 99% of what every user wants. Mini SQL Query aims to satisfy the most common tasks what the average user seeks to achieve, in doing so it keeps the size and complexity of the application to a minimum. 
+
+The original application was developed almost entirely using Microsoft's Visual Studio C# Express IDE.
+
+
+The First Run
+--------------
+
+The very first time you run Mini SQL Query, the application will look similar to the image below:
+
+![Mini SQL Query on first run](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Mini-SQL-Query.png)
+ 
+The first thing you need to do is **configure some sort of connection**. From the menu, select ***Edit > Edit connection strings***. 
+ 
+There are some default connections present, they may not work on your system - they are simply examples. Each has a Name, a Provider and a Connection with optional comments. Selecting one of the items in the left list will display the details on the right.
+
+![](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Mini-SQL-Query--Edit-Connection-Strings.png)
+
+From this point add, modify or copy a connection. 
+
+More...
+-------
+
+See:
+
+- [Basic Usage](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Basic%20Usage.md)
+- [Context Menu Commands](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Context%20Menu%20Commands.md)
+- [Adding a MSSQL Connection](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Adding%20a%20MSSQL%20Connection.md)
+- [Adding an SQLite Connection](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Adding%20an%20SQLite%20Connection.md)
+- [Thank You](https://github.com/paul-kohler-au/minisqlquery/blob/master/src/Docs/Thank%20You.md)
Added +14 -0
diff --git a/minisqlquery-master/src/Docs/Thank You.md b/minisqlquery-master/src/Docs/Thank You.md
new file mode 100644
index 0000000..97dc0f8
--- /dev/null
+++ b/minisqlquery-master/src/Docs/Thank You.md
@@ -0,0 +1,14 @@
+Thank You
+=========
+
+*Mini SQL Query* is written by Paul Kohler (VIRIDIS Software - [http://viridissoftware.com.au/](http://viridissoftware.com.au/); email "paul (at) viridissoftware (dot) com (dot) au")
+
+Also, a special thanks to Kent Carlsle for his contributions “kdcarlisle (at) gmail (dot) com.”
+
+*Mini SQL Query* relies on several other 'free/open source' products to pull together a simple but useful SQL working environment. In no particular order, thank you... 
+
+- **Mark James**, for the Silk icon set [http://www.famfamfam.com/](http://www.famfamfam.com/)
+- **ic#code** for the SharpDevelopSharpDevelop project where I get the ICSharpCode.TextEditor from that removes the need for using an plain old textbox [http://www.icsharpcode.net/OpenSource/SD/](http://www.icsharpcode.net/OpenSource/SD/)
+- **Weifen Luo** for his extremely easy to use WinForms docking suite [http://sourceforge.net/projects/dockpanelsuite/](http://sourceforge.net/projects/dockpanelsuite/)
+- To the **Castle Project** [http://www.castleproject.org/](http://www.castleproject.org/) for the NVelocity text template engine port.
+- To the **Ninject** [http://www.ninject.org/](http://www.ninject.org/) for the dependency injection container