how to create database column within developer

Hello All1

I am using Servoy 6.5 and Postgresql 9.3

I need to create a column in a table with properties of JSON to take advantage of the query possibilities it has. Currently I have jsons stored in varchar column and find it very difficult to query specific strings within it.

I can create the column uisng PGAdmin (postgres) ie json_data and the properties of the column are json

I cannot do this within servoy developer as that choice is not available.

can someone recommend how to create a json column to use in servoy?

Thanks

var server = plugins.maintenance.getServer( serverName );
var table = server.getTable( tableName );
table.createNewColumn( columnName, type, length, allowNull, pkColumn );

or maybe you could try

plugins.rawSQL.executeSQL( serverName, tableName, sql, sql_args );

stevek:
can someone recommend how to create a json column to use in servoy?

There’s no way to do it from Servoy.
You need to do this manually.
Then see what column type the driver is returning in Servoy (probably text)
Normally the driver should take care of the conversion from Servoy to the JSON data type.

Thank you!