DSL Syntax

Following is the syntax for Create, Update Delete of a datasource. A data source could be created using a database adapter and full introspection of the datasource is performed. The datasource could be altered to specify connection properties, authentication properties and annotation later on.

 

DROP DATASOURCE /path/name
 
———————————————————————————————————————————————————————————————
 
CREATE|ALTER DATASOURCE /path/name
 
(RELOCATE AS /path/name)?                                   //only for alter
 
BASED ON ADAPTER 'Oracle 11g (Thin Driver)| File-Delimited' //adapter name, maybe relational, file-delimited, excel
 
(SET NATIVE PROPERTIES {json_object})?
 
(CONNECT USING
 
    (HOST 'xxx.xxx.xxx.xx')?                                //only for relational
    (PORT 1521)?                                            //only for relational
    (DATABASE_NAME 'ordersDatabase')?                       //only for relational
    (SELECT_MODE 'Direct')?                                 //for microsoft sql server datasource url
 
 
    (LOCAL_ROOT_PATH 'localPath' | URL 'url')?              //for file-delimited and MS Excel (non ODBC)
    (FILE_FILTERS '*.xls,*.xlsx')?                          //for file-delimited(default = *.csv,*.txt) and excel (default = *.xls,*.xlsx)
 
    (DSN 'excelodbc')?                                      //for MS Excel (ODBC))?
 
-- relational
(AUTHENTICATE
 
    (IN [BASIC | KERBEROS] MODE)?                           //for relational default = BASIC
 
    USING                          
 
    (DOMAIN 'domainName')?                                  //for file-delimited
 
    (LOGIN 'username')?                                     //for relational and file-delimited
    (PASSWORD 'password')? 
    (PASS_THROUGH_LOGIN [TRUE|FALSE])?                      //for relational basic mode of authentication
    (TICKET_CACHE 'ticketCache' | NULL)?                    //for relational kerberos mode of authentication
    (USE_PASS_THROUGH_CERTIFICATE_FOR_ENCRYPTION [TRUE|FALSE])? )?      //for relational kerberos mode of authentication default = false
 
)?
 
(FORMAT USING
 
        (CHARACTER_SET 'iso-8859-1')?                       //for file-delimited and excel, defaults based on adapter for allowable values : Refer Section 1, 2, 3
 
        (DELIMITER ',')?                                    //for file-delimited default = ','allowable values : Refer Section 1, 2
 
        (TEXT_QUALIFIER '"')?                               //for file-delimited default = '"' allowable values : Refer Section 1, 2
        (STARTING_ROW 1)?                                   //for file-delimited default = 1
 
        (HAS_HEADER_ROW [TRUE|FALSE])?                      //for file-delimited(default = FALSE) and excel(default = TRUE)
 
        (IGNORE_TRAILING_DELIMITER)?                        //for file-delimited default = TRUE
 
        (DATA_RANGE ‘A1’)?                                  //for MS Excel (non-ODBC) default = A1
 
        (BLANK_COLUMN_TYPE ‘Varchar')?                      //for excel default = Varchar, allowable values: Varchar, Double, Boolean, Datetime
        (FIRST_ROW_CATEGORY [TRUE | FALSE])?                //for excel default = true
 
        (IGNORE_INVALID_DATA_FETCH [TRUE | FALSE])?         //for excel default = true
 
        (DATA_WYSIWYG [TRUE|FALSE])?                        //for excel default=true
 
        (BLANK_AS_NULL [TRUE|FALSE])?                       //for excel default = true)?
 
(SET ANNOTATION 'this is a datasource created using DSL api' | NULL)?