codefori / vscode-ibmi

🌍 IBM i development extension for VS Code
https://codefori.github.io/docs/#/
MIT License
277 stars 93 forks source link

Investigate ssh2 & SQLite as a backend for extension testing #1686

Open worksofliam opened 9 months ago

worksofliam commented 9 months ago

Removing the need for an external server would be out of this world. Of course, this would only pertain to working with the database and not uploading/downloading files. Wild idea.

edit: now that i have put together more comments, this seems like a crazy idea, like seriously crazy

worksofliam commented 9 months ago

Let me double up this idea. SSH2 as an SSH server that we could connect to for testing?

https://www.npmjs.com/package/ssh2#password-and-public-key-authentication-and-non-interactive-exec-command-execution

This means perhaps a Node.js env that would replicate some of the pase environment functionality we use. Sounds absolutely mental.

Next step is to investigate our usage of IBM i in our tests and try to make sure our edge cases are covered

worksofliam commented 9 months ago

CL commands being used:

        `QSYS/CPYTOIMPF FROMFILE(${library}/${file} ${member}) ` +
        `TOSTMF('${tempRmt}') ` +
        `MBROPT(*REPLACE) STMFCCSID(1208) RCDDLM(*CRLF) DTAFMT(*DLM) RMVBLANK(*TRAILING) ADDCOLNAM(*SQL) FLDDLM(',') DECPNT(*PERIOD)`

pase commands being used:

sql statements being used:

        select os.OBJNAME as ODOBNM
             , coalesce(os.OBJTEXT, '') as ODOBTX
             , os.OBJATTRIBUTE as ODOBAT
          from table( SYSTOOLS.SPLIT( INPUT_LIST => '${libraries.toString()}', DELIMITER => ',' ) ) libs
             , table( QSYS2.OBJECT_STATISTICS( OBJECT_SCHEMA => 'QSYS', OBJTYPELIST => '*LIB', OBJECT_NAME => libs.ELEMENT ) ) os
        SELECT
          b.avgrowsize as MBMXRL,
          a.iasp_number as MBASP,
          cast(a.system_table_name as char(10) for bit data) AS MBFILE,
          cast(b.system_table_member as char(10) for bit data) as MBNAME,
          coalesce(cast(b.source_type as varchar(10) for bit data), '') as MBSEU2,
          coalesce(b.partition_text, '') as MBMTXT,
          b.NUMBER_ROWS as MBNRCD,
          extract(epoch from (b.CREATE_TIMESTAMP))*1000 as CREATED,
          extract(epoch from (b.LAST_SOURCE_UPDATE_TIMESTAMP))*1000 as CHANGED
        FROM qsys2.systables AS a
          JOIN qsys2.syspartitionstat AS b
            ON b.table_schema = a.table_schema AND
              b.table_name = a.table_name
              statement = `with VARIANTS ( HASH, AT, DOLLARSIGN ) as (`
                + `  values ( cast( x'7B' as varchar(1) )`
                + `         , cast( x'7C' as varchar(1) )`
                + `         , cast( x'5B' as varchar(1) ) )`
                + `)`
                + `select HASH concat AT concat DOLLARSIGN as LOCAL`
                + `  from VARIANTS; `;
worksofliam commented 8 months ago
worksofliam commented 8 months ago

Looks like the npm package doesn't support creating functions, but dotnet does?