Menu

2.0 build 4978 Beta test release with database access

This is an early test release, I have done minimal testing.
Macros can now use the ScriptDatabase class, which provides two very basic methods:

  ExecuteNonQuery(string DatabaseName, string SQLStatement)
  SelectToJSON(string DatabaseName, string SQLStatement)

These both return a JSON string value which can then be interpreted and used in the macro.
The example macro "Example 5 - Use sample DB" (example5-sample-db.html) shows a very simple technique for saving a segment from the current file into a data table, and retrieving a set of segments out of the table.

Database connections must be defined in the application settings, File/Settings/Databases, where you can define a name, to be used in the macro methods, and the associated database type and connection string. The available database types are those which have a DbProviderFactory driver registered for the .Net framework - see MSDN - DBProviderFactory. I have used this with SqlServer and PostgreSQL and believe many other database types should be accessible.

As I said, its an early test release, so anybody wanting to make use of database access in macros, please register for the sourceforge forums, give feedback on what you find, problems you encounter or what you want to see added.

Posted by Les Ferguson 2013-08-18

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.