Hi Dilini, Since RDBMS tables could have only unique table names this should be possible. Once concern is that do we handle the errors thrown due to key constraints in the current implementation? The proposed solution assumes that the age column can have null values. If the age column was defined with NOT NULL constraint, then IMO we should throw a meaningful error message to the Siddhi programmer telling that there is a column named "age" in the ownerTable which needs to have some value other than NULL.
-- Thanks, Miyuru Dayarathna Senior Technical Lead Mobile: +94713527783 Blog: http://miyurublog.blogspot.com On Tue, Mar 13, 2018 at 2:12 AM, Dilini Muthumala <[email protected]> wrote: > Hi all, > > Currently in SP 4.0.0, RDBMS Store, when defining the Store, users have to > make sure to define the Store in such a way that all of the columns in the > actual physical table are present in the Store definition. > > Example: > *Actual table definition (assume, this is defined in mysql):* > > *Field* > > *Type* > > *name* > > varchar(20) > > *owner* > > varchar(20) > > *age* > > int(11) > > *Siddhi App:* > @Store(type='rdbms', .....) > define table ownerTable (*name string, owner string, age int*); > > *Issue:* > There could be scenario where the Siddhi app is never supposed to insert > into some of the columns in the table (and let those columns have NULL > after the INSERT) [1] > > This is fixed in [2]. With this fix in place, users can define the event > table with only the columns that need to be used in the INSERT. > > E.g. > Let us assume the Siddhi app never insert into age column. > > Then he can define the Store as below: > *Siddhi App:* > @Store(type='rdbms', .....) > define table ownerTable (*name string, owner string*); > > Any concerns on this? Do the other Store types have the same problem? > > Thanks, > Dilini > > [1] https://github.com/wso2-extensions/siddhi-store-rdbms/issues/73 > [2] https://github.com/wso2-extensions/siddhi-store-rdbms/pull/74 > -- > *Dilini Muthumala* > Senior Software Engineer, > WSO2 Inc. > > *E-mail :* [email protected] > *Mobile: *+94 713-400-029 <+94%2071%20340%200029> > -- Thanks, Miyuru Dayarathna Senior Technical Lead Mobile: +94713527783 Blog: http://miyurublog.blogspot.com
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
