gwen-interpreter / gwen

Core Gwen interpreter
https://gweninterpreter.org
Apache License 2.0
36 stars 8 forks source link

Gwen doesnt support for sql statements using DSL (apart from select) #34

Closed anshu781126 closed 7 years ago

anshu781126 commented 7 years ago
defined in the database by sql "" this dsl supports select, have tested it but we dont have any dsl for update or create (any other ddl or dml)
bjuric commented 7 years ago

We haven't provided this capability because it is a data management concern. But you can call out to external scripts (like sqlplus scripts for example) using the system process DSL as follows to achieve what you need:

I execute system process "insert call to script here"

bjuric commented 7 years ago

@anshu781126, did you give the above a try?

anshu781126 commented 7 years ago

Yes this works but for this I need to maintain a piece of code which invokes some sql client. It would be more convenient to directly use dsl; like other automation tool supports. Data Management can be part of testcases so in that case user will be at ease if he gets to do it by DSL rather than maintaining additional piece of code.

bjuric commented 7 years ago

My concern is that this could open up a whole world of data management problems and issues that could result in high maintenance and instability for Gwen. Also, since you are using a native SQL client, it makes sense to call out to it through the system process DSL. That's the precise reason we provide that DSL; so native capabilities can be utilised in a way that they are not coupled to Gwen.

bjuric commented 7 years ago

@anshu781126, we've given it some thought and propose to provide some basic support for executing SQL insert, update, or delete statements with the following DSL:

We've implemented this in the snapshot build below. Please download it and try it out (see example usage above):

Let us know how it goes.

anshu781126 commented 7 years ago

Working fine for update.

bjuric commented 7 years ago

Released in gwen-web v2.12.0