{"id":22117448,"url":"https://github.com/terma/gigaspace-web-console","last_synced_at":"2025-07-25T11:32:34.967Z","repository":{"id":25520593,"uuid":"28952526","full_name":"terma/gigaspace-web-console","owner":"terma","description":"Open source alternative for GigaSpace Web UI with enhanced data querying.","archived":false,"fork":false,"pushed_at":"2017-10-04T21:06:21.000Z","size":2741,"stargazers_count":4,"open_issues_count":27,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-07-26T22:09:32.061Z","etag":null,"topics":["gigaspaces","query-engine","sql","tools","webconsole"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-08T06:34:04.000Z","updated_at":"2020-07-16T14:26:49.000Z","dependencies_parsed_at":"2022-09-26T21:41:23.881Z","dependency_job_id":null,"html_url":"https://github.com/terma/gigaspace-web-console","commit_stats":null,"previous_names":[],"tags_count":47,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terma%2Fgigaspace-web-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terma%2Fgigaspace-web-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terma%2Fgigaspace-web-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terma%2Fgigaspace-web-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terma","download_url":"https://codeload.github.com/terma/gigaspace-web-console/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227568786,"owners_count":17787653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gigaspaces","query-engine","sql","tools","webconsole"],"created_at":"2024-12-01T13:33:57.127Z","updated_at":"2025-07-25T11:32:34.953Z","avatar_url":"https://github.com/terma.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GigaSpaces SQL Console\n\n[![Build Status](https://travis-ci.org/terma/gigaspace-web-console.svg)](https://travis-ci.org/terma/gigaspace-web-console) [![Coverage Status](https://coveralls.io/repos/terma/gigaspace-web-console/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/terma/gigaspace-web-console?branch=master) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.terma.gigaspace-web-console/server/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.terma.gigaspace-web-console/server/)\n\nPowerful alternative for GigaSpace Management Console when you have a lot of work with spaces data, especially for Quality Assurance Team. Open Source Apache 2.0\n\n* [42](#42)\n * [License](#license)\n * [Contacts](#contacts)\n * [Features](#key-features)\n* [How to run](#how-to-run)\n* [How to use](#how-to-use)\n * [Execute SQL Queries](#execute-sql-queries)\n    * [SQL on JSON](#sql-on-json)\n * [Nice representation custom datatypes](#nice-representation-custom-datatypes)\n    * [Representation for Oracle XML Type](#representation-for-oracle-xml-type)\n * [Registered Types and Counts](#registered-types-and-counts)\n    * [Counts History](#counts-history)\n    * [Counts By Partitions](#counts-by-partitions)\n * [Execute Groovy](#work-with-groovy)\n    * [JSON](#work-with-json)\n * [Copy data between spaces](#copy-data-between-spaces)\n * [Export / Import data](#export--import-data)\n\n# 42\n\n## License\n\n[Apache 2.0](https://github.com/terma/gigaspace-web-console/blob/master/LICENSE)\n\n## Contacts \n\n_Thx a lot for any feedback_\n\n* Convert you point to feature or defect [here](https://github.com/terma/gigaspace-web-console/issues)\n* artem.stasuk@gmail.com\n* Skype artem.stasuk\n\n## Key Features \n\n_Almost everything what you want but can't find in GigaSpace Management Console for data quering_\n\n* Supports all versions of GigaSpace starts from 9.X (never tested with previous) from one page\n* One click switch between different instances, versions and spaces\n* Supports detailed view for embedded data, so no more ```my.package.Object@12223``` in results\n* Super view for types counts with filtering by name, non zero and date and count of last update\n* Supports multiqueries and comments when you have complex work with data\n* All settings store cross session, so you don't need to retype your queries again\n* Copy data between spaces\n* Export query result to CSV\n* Support Groovy language in console\n* Export / Import data between spaces\n\n# How to Run\n\n## Just Run and Use\n\n```console\n$ mvn com.github.terma.gigaspace-web-console:plugin:console\n```\n\nUseful parameters:\n\n* ```-DgsVersion=\u003cGS_VERSION\u003e``` - to specify version of Gigaspace (will takes it from your maven repository)\n* ```-Dport=\u003cPORT\u003e``` - specify port to run by default ```7777```\n* ```-DconfigPath=file:\u003cFILE_PATH\u003e``` - if need to provide custom config\n\n## Integrate in other app\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.terma.gigaspace-web-console\u003c/groupId\u003e\n    \u003cartifactId\u003eserver\u003c/artifactId\u003e\n\u003c/dependency\u003e\n```\n\n1. Prepare config file (JSON format) \n```json\n{\n  \"comment\": \"list of all versions of GigaSpace which you want to use\",\n  \"gs\": [\n    {\n      \"comment\": \"any name just for user\",\n      \"name\": \"GS-10\",\n      \"comment\": \"list of GigaSpace libraries (you can use that as minimun)\",\n      \"libs\": [ \n        \"/my-path/gs-runtime-10.0.1-11800-RELEASE.jar\",\n        \"/my-path/gs-openspaces-10.0.1-11800-RELEASE.jar\",\n        \"/my-path/spring-beans-3.2.4.RELEASE.jar\",\n        \"/my-path/commons-logging-1.1.1.jar\",\n      ]\n    }\n  ],\n  \"links\": [\n    {\n      \"name\": \"Name just for user\",\n      \"url\": \"any link\"\n    }\n  ],\n  \"comment\": \"List of converters which will be used to render your custom embedded types in space, could be empty so we will reference name\",\n  \"converters\": [\n    \"my.package.CustomTypeConverter\"\n  ],\n  \"comment\": \"predefined list of GigaSpace spaces which you have, so you don't need to enter all details manualy on page. Any way you can customize them from UI too\",\n  \"gigaspaces\": [\n    {\n      \"name\": \"GS-10 - visible name\",\n      \"url\": \"jini:/*/*/gs10?locators=localhost:4700 - GS URL\",\n      \"user\": \"could be blank if you have unsecured space\",\n      \"password\": \"could be blank if you have unsecured space\",\n      \"driver\": \"\",\n      \"unmanaged\": \"set to true if your space is deployed outside of GS cluster like embedded space\",\n      \"secure\": \"set to true if you want UI to check that you enter password before any query so no locked account\"\n    }\n  ]\n}\n```\n1. Pass JVM option ```-DgigaspacewebconsoleConfig=\u003cclasspath:X\u003e or \u003cfile:X\u003e``` to your Web Container\n1. Start within any Web Container like Jetty, Tomcat etc.\n1. Open web app in browser\n\n# How to use\n\nWhen you start your console first time after configuration you will see:\n\n![Start](https://raw.githubusercontent.com/terma/gigaspace-web-console/master/img/start.png)\n\n## Execute SQL queries\n\nSelect preconfigured space or type url details and click on -Query- tab\n\n* You can enter more than one query when you run them they will be execute in independenly so you will get all results as on example below\n* To disable execution of some query without remove just comment it by ```#``` or ```//``` or ```--```\n* Supports ```select```, ```update```, ```delete```\n* For ```delete``` and ```update``` result will be count of modified records\n* For ```select``` you will get result table and count of records\n* When value size for one cell more ```50``` result will be truncated, so ```result``` plus ```...``` to show full result just click on ```Show/Hide all text``` under each result table\n* For columns which looks like timestamp you can click on ```T?``` after column name so console shows result in date format for example ```1424054208000``` will be show as ```1424054208000 = Mon, 16 Feb 2015 02:36:48 GMT```\n\n![Execute SQL Queries](https://raw.githubusercontent.com/terma/gigaspace-web-console/master/img/execute.png)\n\n### Work with timestamps\n\nThat's general case when you have data stored with timestamp and you need to query by it. Instead of typing exactly count of millis from 1970 like:\n```select * from Book where created \u003c 1435028867000```\nyou can:\n```select * from Book where created \u003c TODAY-1d```\nor\n```select * from Book where created \u003c NOW-1d```\nYou can use ```-``` or ```+``` with ```d|w|h``` and ```TODAY``` means start of day when ```NOW``` means current millis\n\n### Search documents with properties like \n\nSometimes you need to find documents with specific property. As example: application stores documents with property specified for each date like P-2016-05-11=true etc. How to find documents for 2016? \n\n_This type of query required full scan so be careful on PROD =)_\n\n```select * from MyDocs where property 'P-2016%'```\n\n### SQL on JSON\n\nBased on https://github.com/terma/sql-on-json\n\nIn case if your database does not support native JSON column type or you just need to perform\ncomplex query on data stored in JSON format in database. Use function \n```sql_on_json(\u003cSQL to select JSON\u003e) \u003cSQL on JSON converted to DB\u003e``` \n\n#### How it works:\n1. Execute ```SQL to select JSON``` and get first row\n1. Extract first column which expected to be ```string or clob``` with JSON object\n1. Convert all fields of JSON object with type array to tables in in-memory database\n1. Execute ```\u003cSQL on JSON converted to DB\u003e``` on top of created database\n1. Provide result\n\n#### Example:\n\nGiven: \n```sql\ncreate table ACCOUNT (state varchar(4000))\ninsert into ACCOUNT values (\"{transactions:[{id:10,orderid:23}],orders:[{id:23}]}\")\n```\n\nWhen:\n```sql\nsql_on_json(select state from ACCOUNT limit 1) select * from transactions t where t.orderid in (select id from orders)\n```\n\nThen:\n\n id | orderid  \n ------------- | ------- \n 10      | 23  \n\n### Nice representation custom datatypes\n\nGigaspace can store any type of data marked as ```java.io.Serializable```, default configuration of console support converters (nice representation) for all types and next complex nested types:\n* ```com.gigaspaces.document.SpaceDocument```\n* ```com.gigaspaces.entry.VirtualEntry```\n* ```com.gigaspaces.document.DocumentProperties```\n* ```java.util.Map```\n* ```java.lang.Iterable```\n\n#### Converter for custom type:\n \n* create class with one method (you don't need to implement any interface or abstract class):\n```java\npublic static String convert(Object o) {\n   if (o instanceof \u003cMY_TYPE\u003e) return \u003cMY REPRESENTATION\u003e;\n   else return null; // should return null when doesn't support incoming type so it could be handled by other converter\n}\n```\n* add converter in console classpath\n* add it to console configuration in to section ```converters```, for example:\n```json\n\"converters\": [\n    \"MY_CONVERTER_FULL_CLASS_NAME_1\",\n    \"MY_CONVERTER_FULL_CLASS_NAME_2\"\n]\n```\n\n#### Representation for Oracle XML Type\n\nStandard Oracle JDBC driver doesn't not support native XML datatype. As result sometimes you will see\n```NullPointerException``` or just get ```null``` value for that column, however you can fix that:\n\n* First of all add to class path next dependencies (check proper version):\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.oracle\u003c/groupId\u003e\n  \u003cartifactId\u003exdb\u003c/artifactId\u003e\n  \u003cversion\u003e11.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003eoracle.xml\u003c/groupId\u003e\n  \u003cartifactId\u003exmlparserv2\u003c/artifactId\u003e\n  \u003cversion\u003e11.2.0.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n* Then create converter for Oracle XML Type ```oracle.xdb.XMLType```:\n```java\npublic class OracleXmlTypeConverter {\n\n    public static String convert(final Object value) {\n        if (value instanceof XMLType) {\n            final XMLType xmlTypeValue = (XMLType) value;\n            try {\n                return xmlTypeValue.getStringVal();\n            } catch (SQLException e) {\n                throw new RuntimeException(e);\n            }\n        } else {\n            return null;\n        }\n    }\n\n}\n```\n* add it to classpath of your console\n\n## Registered types and counts\n\n![Registered Types and Counts](https://raw.githubusercontent.com/terma/gigaspace-web-console/master/img/types.png)\n\n### Counts History\n\nOn Types Tab you for any type you can click History to track dynamic of count\n\n![Counts History](https://raw.githubusercontent.com/terma/gigaspace-web-console/master/img/counts-history.png)\n\n### Counts By Partitions\n\nBy switching Partitions/Space on Types Tab you can see count for space or partitions. That helps a lot \nwhen you need to how good your routing keys\n\n![Counts By Partitions](https://raw.githubusercontent.com/terma/gigaspace-web-console/master/img/counts-by-partitions.png)\n\n## Work with Groovy\n\nSometimes you have complex queries which depends on each other or complex calculation. For example I want to collect all values from select to one string. How I can do that?\n\nFirst of all enable groovy by adding ```groovy``` word in first line of editor.\nSecond, create simple [Groovy](http://groovy.codehaus.org/) script and run it in console!\n\n![Execute Groovy Script](https://raw.githubusercontent.com/terma/gigaspace-web-console/master/img/groovy.png)\n\nA few additional words about Groovy in console. Withing your script you can use all groovy features (don't forget about proper import) plus a few additional: \n\n* ```java SqlResult sql(sql: java.lang.String)``` - function which can execute any SQL in GigaSpace and return result\n\n```java \npublic interface SqlResult {\n    boolean next() throws SQLException;\n    List\u003cString\u003e getColumns() throws SQLException;\n    List\u003cString\u003e getRow() throws SQLException;\n    String getSql();\n}\n```\n\n* ```java void out(message: java.lang.Object)``` - print any result to console output\n* ```java gs``` - ref on GigaSpace instance\n\n### Work with JSON\n\nIf you want to work with JSON stored in document fields you can use Groovy JSON API http://docs.groovy-lang.org/latest/html/gapi/groovy/json/JsonSlurper.html\n\nExample:\n\n```groovy\ngroovy\ndef slurper = new groovy.json.JsonSlurper()\ndef result = slurper.parseText('{\"person\":{\"name\":\"Guillaume\",\"age\":33,\"pets\":[\"dog\",\"cat\"]}}')\nresult.person.name\n```\n\n### Useful fast scripts\n\nShow space type description:\n```java  \ngroovy\ngs.typeManager.getTypeDescriptor(\"typeName\")  \n```\n\n*Clean all data from space! Think twice!*\n```java  \ngroovy\ngs.clear(null)  \n```\n\n## Copy data between spaces\n\n![Copy data between spaces](https://raw.githubusercontent.com/terma/gigaspace-web-console/master/img/copy.png)\n\n### Copy part of data\n\nIf you don't have criteria to limit you dataset for copy by business field. You can use ```from X only Y``` notation in copy queries for example to copy from 1k set 200 documents start from 160 you need:\n\n```copy MyDocs from 160 only 200```\n\n## Export / Import data\n\nTBD =)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterma%2Fgigaspace-web-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterma%2Fgigaspace-web-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterma%2Fgigaspace-web-console/lists"}