Click & Run — Harbour / MariaDB / Node.js for Desktop

Post Reply
User avatar
Otto
Posts: 7020
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Click & Run — Harbour / MariaDB / Node.js for Desktop

Post by Otto »

Hello friends,
Zero-install setup.
Copy & paste only.

I just ran a real-world test on a completely fresh PC.

I copied only three portable components:
Harbour executable
portable MariaDB
portable Node.js

No installer.
No registry entries.
No system configuration.

After copying the folder, I simply:

started MariaDB
started Node.js via a small start.bat
launched the Harbour application

What happens next:
Harbour.exe inserts 100 new records
immediately after that, it reads the complete table (1,000 rows)
all communication goes through the Node.js SQL service

JSON over local IPC
Total runtime: 7 ms end-to-end

This includes:
JSON encode / decode
service hop
SQL execution
result transport back to Harbour

Nothing preloaded.
Nothing cached.
Fresh machine.

For me, this confirms a few important points:

a service-based SQL approach is not slow
JSON + IPC overhead is negligible
the whole stack is fully portable
no SQL client DLLs inside Harbour
no TLS stacks, no ABI or compiler coupling

You can literally copy the folder to another PC and run it.
This is exactly the result I was hoping for by separating responsibilities:

Harbour → business logic & orchestration

Service → SQL & infrastructure

Very happy with this outcome.
Best regards,
Otto

Image

Image

User avatar
Otto
Posts: 7020
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Click & Run — Harbour / MariaDB / Node.js for Desktop

Post by Otto »

Code: Select all | Expand

 FUNCTION SQL_request()

  LOCAL cReply, hJson
  LOCAL nLimit  := 1000
  LOCAL nOffset := 0
  LOCAL cCmd
   
  /* --- WebSocket connect --- */
  IF ws_init() != 0 .OR. ;
     ws_connect( "127.0.0.1", 8082 ) != 0 .OR. ;
     ws_handshake( "127.0.0.1:8082", "/" ) != 0
     RETURN NIL
  ENDIF
   
  /* --- Command bauen --- */
  cCmd := ;
     '{ "cmd": "LIST_CUSTOMERS", ' + ;
     '"limit": '  + hb_ntos( nLimit ) + ', ' + ;
     '"offset": ' + hb_ntos( nOffset ) + ' }'
   
  /* --- Request / Response --- */
  ws_send_text( cCmd )
  cReply := ws_recv_text()
   
  /* --- JSON → Array für xBrowse --- */
  IF ! Empty( cReply )
   
     hJson := hb_jsonDecode( cReply )
   
     IF ValType( hJson ) == "H" .AND. hb_HHasKey( hJson, "rows" )
   
        aData := {}   // alte Daten verwerfen
   
        AEval( hJson["rows"], {|h|
           AAdd( aData, ;
              { ;
                 hb_ntos( h["id"] ), ;
                 h["name"], ;
                 h["city"] ;
              } )
        } )
   
        oBrw:SetArray( aData )
        oBrw:Refresh()
   
     ENDIF
  ENDIF
   
  ws_close()
  ws_cleanup()
   
   RETURN NIL

Image

User avatar
Otto
Posts: 7020
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Click & Run — Harbour / MariaDB / Node.js for Desktop

Post by Otto »

Image

Post Reply