The MySQL plug-in allows you to access, query, and write data to MySQL database servers with Grasshopper. SQL stands for "structured query language" and allows you to set up some rather sophisticated relationships between large sets of data.
I have been experimenting with using MySQL as a data store for shared parameters and other information that multiple instances of Grasshopper (or other software) can access and use.
I finally had time to watch the last two of your tutorials on Slingshot. I think the changes from 0.5 to 0.6 will make a big difference in being able to understand it right away. I really wish I had this when I was working on my Thesis project. I really think it will help on large definition files in allowing me to break them into multiple files.
I'm trying to use slingshot's latest version with Postgres, and somehow when i try to connect it, it always returns the same message:
{0} 0. System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle) at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions) at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.Odbc.OdbcConnection.Open() at SlingshotDB.GHODBC_QUERY.SolveInstance(IGH_DataAccess DA)
Apparently all settings seem to be fine. Server is running on localhost, default port. Databases already loaded and ODBC drivers updated. The only problem is accessing them via grasshopper. I've managed to establish connection to a mysql server, but no success with postgres.
I will take another look at the ODBC driver tonight to see if I can replicate your error. It seems to be working fine with my install of Postgres which makes me think that your DB configuration may be a little different.
Pedro, I looked into your issue further and I am able to replicate the error if the connection string is incorrect. Make sure you specify the database name you are connecting to.
Additionally, some SQL queries supported in MySQL are not supported in Postgres or there may be slight differences in syntax... for example "SHOW databases;" is not supported in Postgres.
While I have provided a few connection components, they may not be appropriate for all cases. ConnectionStrings.com is a great resource for finding the correct means of connecting to a remote database.
I have created a page for Slingshot! documentation and tutorials... It is still a work-in-progress but hopefully it is information new users will find helpful.
I did it with a ODBC connection to a postgreSQL server. So yes, it is possible. You have to store the shape file into the database and then convert the geometry from WKB to text, so that grasshopper can draw the polygons.
I have found a syntax error in the SQL Code of the Create Point Database component. The closing brackets of the CREATE TABLE line seems to be missing (In red on the following picture).
I'm having trouble with the Create Mesh Database component. When I insert a mesh (basic mesh sphere), and put this into the command line, I get this error:
MySql.Data.MySqlClient.MySqlException (0x80004005): Column count doesn't match value count at row 1
I checked the mySQL database and the table seems to log faces but there are not values for the vertices. Any suggestions?
I just took a look and it might have to do with the INSERT statement for the vertices is expecting a 'color' value for that column... which is not being provided with the values. I tested the component on my end before release so I will verify if this is, indeed, the problem.
Can I ask if you are using the most recent version or an older one? I'll add this fix to my list for my next build.
The SQL syntax for that component in that version seems to be correct.
I was trying out some vertex color in the new version and must have forgotten to circle back before releasing v0.88... sloppy work on my part. I will correct in the next release. For now, stick with v0.82 if you need that component.
When I query the face vertices from a mesh database, it shifts the face list. For example, if I have a four vertex mesh, the databse will give me a face of T{1;2;3;4} when I really want T{0;1;2;3}. I'm subtracting 1 from each value right now to get the desired result, but I just wanted to let you know in case there are issues with other users.
I'm having trouble getting the "select" query to work. When submitting the query in GH 9.0064, I get this error:
System.InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid. at Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) at SlingshotDB.GHMYSQL_Query.SolveInstance(IGH_DataAccess DA)
Nate, I just upgraded to the build you posted about a week ago and don't see any components for creating tables or columns. Is it possible to create/store extra columns of data alongside meshes in a mesh database?
Mohamed Naeim
May 1, 2011
Nathan Miller
Hello Mohamed,
The MySQL plug-in allows you to access, query, and write data to MySQL database servers with Grasshopper. SQL stands for "structured query language" and allows you to set up some rather sophisticated relationships between large sets of data.
I have been experimenting with using MySQL as a data store for shared parameters and other information that multiple instances of Grasshopper (or other software) can access and use.
Video examples are coming soon.
May 1, 2011
Nate Holland
May 6, 2011
Miguel Vidal
Jul 13, 2011
Arthur Mamou-Mani
Hi Nathan,
Thanks so much for your plugin!
Hereafter is a conversation which mentions Slingshot:
http://www.grasshopper3d.com/forum/topics/keep-last-galapagos-round...
I hope you can help :)
Many thanks,
Arthur
Sep 7, 2011
Nathan Miller
Sep 11, 2011
Nathan Miller
Slingshot! Database v0.8.0.0 has been released. This is a major update with new features and workflow (and probably bugs!) Read more here.
Oct 13, 2011
Pedro Arrobas da Silva
hello,
I'm trying to use slingshot's latest version with Postgres, and somehow when i try to connect it, it always returns the same message:
{0}
0. System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)
at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions)
at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.Odbc.OdbcConnection.Open()
at SlingshotDB.GHODBC_QUERY.SolveInstance(IGH_DataAccess DA)
Does any1 know how to solve this problem?
Tks a lot,
Pedro.
Dec 7, 2011
Nathan Miller
Pedro, You may to need to verify your Server IP and Port. Are you accessing the Postgres server though localhost or is this for remote access?
Dec 7, 2011
Pedro Arrobas da Silva
Apparently all settings seem to be fine. Server is running on localhost, default port. Databases already loaded and ODBC drivers updated. The only problem is accessing them via grasshopper. I've managed to establish connection to a mysql server, but no success with postgres.
Dec 9, 2011
Nathan Miller
I will take another look at the ODBC driver tonight to see if I can replicate your error. It seems to be working fine with my install of Postgres which makes me think that your DB configuration may be a little different.
Dec 9, 2011
Nathan Miller
Pedro, I looked into your issue further and I am able to replicate the error if the connection string is incorrect. Make sure you specify the database name you are connecting to.
Additionally, some SQL queries supported in MySQL are not supported in Postgres or there may be slight differences in syntax... for example "SHOW databases;" is not supported in Postgres.
-Nathan
Dec 10, 2011
Nathan Miller
Something that may be of help to everyone: http://www.connectionstrings.com
While I have provided a few connection components, they may not be appropriate for all cases. ConnectionStrings.com is a great resource for finding the correct means of connecting to a remote database.
-Nathan
Dec 11, 2011
Nathan Miller
Dear Slingshot! Database users,
I have created a user survey in the hopes of improving the plug-in and determining new development possibilities.
User Survey
Please take a moment and fill it out!
Best,
Nathan
Dec 15, 2011
Nathan Miller
Greetings,
I have created a page for Slingshot! documentation and tutorials... It is still a work-in-progress but hopefully it is information new users will find helpful.
http://slingshot-dev.wikidot.com/tutorials
Jan 8, 2012
Nathan Miller
The Slingshot! development wiki (along with my other pages) have gone into blackout mode in protest of SOPA and PIPA. Sorry for any inconvenience... but this is important. Learn what this is all about.
Jan 18, 2012
Nathan Miller
Site is back up... here is the Twitter component engaged in some opposition...!
Jan 18, 2012
Toussaint Jimenez Rojas
Nathan its posible to link any GIS to GH with Slingshot, the GIS its in Shape Format File just Guess ?
May 7, 2012
Pedro Arrobas da Silva
Hello Toussaint,
I did it with a ODBC connection to a postgreSQL server. So yes, it is possible. You have to store the shape file into the database and then convert the geometry from WKB to text, so that grasshopper can draw the polygons.
May 13, 2012
Simon Moreau
Hello
I have found a syntax error in the SQL Code of the Create Point Database component. The closing brackets of the CREATE TABLE line seems to be missing (In red on the following picture).
May 30, 2012
Erick Katzenstein
Nathan, thanks for all your hard work.
I'm having trouble with the Create Mesh Database component. When I insert a mesh (basic mesh sphere), and put this into the command line, I get this error:
MySql.Data.MySqlClient.MySqlException (0x80004005): Column count doesn't match value count at row 1
I checked the mySQL database and the table seems to log faces but there are not values for the vertices. Any suggestions?
Jun 6, 2012
Nathan Miller
Hello Erick,
I just took a look and it might have to do with the INSERT statement for the vertices is expecting a 'color' value for that column... which is not being provided with the values. I tested the component on my end before release so I will verify if this is, indeed, the problem.
Can I ask if you are using the most recent version or an older one? I'll add this fix to my list for my next build.
-Nathan
Jun 6, 2012
Erick Katzenstein
Thanks for looking into this. I'm using the most recent version of Slingshot and MySQL.
Jun 6, 2012
Nathan Miller
Erick,
Since you are just using MySQL, see if you get the same error with version 0.82 available on Food4Rhino. http://www.food4rhino.com/project/slingshot
The SQL syntax for that component in that version seems to be correct.
I was trying out some vertex color in the new version and must have forgotten to circle back before releasing v0.88... sloppy work on my part. I will correct in the next release. For now, stick with v0.82 if you need that component.
-Nate
Jun 6, 2012
Erick Katzenstein
Great, thanks for your help.
-Erick
Jun 6, 2012
Nathan Miller
Hello Erick,
I have corrected the syntax issue with the new build (0.882)... see the new discussion above. 2 new components are also available for testing.
-Nate
Jun 7, 2012
Nathan Miller
That voice is like silk... and the content is even better! ;)
Jul 24, 2012
Philipp
is it possible to make a component to somehow send a Get command with custom query to any API
Sep 25, 2012
Erick Katzenstein
When I query the face vertices from a mesh database, it shifts the face list. For example, if I have a four vertex mesh, the databse will give me a face of T{1;2;3;4} when I really want T{0;1;2;3}. I'm subtracting 1 from each value right now to get the desired result, but I just wanted to let you know in case there are issues with other users.
Dec 11, 2012
Erick Katzenstein
I'm having trouble getting the "select" query to work. When submitting the query in GH 9.0064, I get this error:
System.InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.
at Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value)
at SlingshotDB.GHMYSQL_Query.SolveInstance(IGH_DataAccess DA)
Is anyone able to replicate this issue?
Nov 22, 2013
Nate Holland
Nate, I just upgraded to the build you posted about a week ago and don't see any components for creating tables or columns. Is it possible to create/store extra columns of data alongside meshes in a mesh database?
Jan 2, 2014