File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 </ head >
99
1010 < body class ="p-4 ">
11- < h1 > SQLite Cloud Driver </ h1 >
12- < div class ="pb-6 ">
13- < a href ="https://www.npmjs.com/package/sqlitecloud "> npm sqlitecloud</ a >
11+ < h1 > SQLite Cloud Drivers </ h1 >
12+ < div class ="pb-6 text-sm ">
13+ < a href ="https://www.npmjs.com/package/@ sqlitecloud/drivers "> npm add @ sqlitecloud/drivers </ a >
1414 </ div >
1515
1616 <!-- Add the text field and button here -->
1717 < div class ="pb-2 ">
18- < div class ="text-sm w-12 "> connectionString: </ div >
18+ < div class ="text-xs w-12 "> databaseUrl </ div >
1919 < input
2020 type ="text "
2121 id ="connectionStringInput "
@@ -65,7 +65,13 @@ <h2 class="pb-4">Results:</h2>
6565
6666 sendButton . addEventListener ( 'click' , ( ) => {
6767 if ( ! database ) {
68- database = new window . sqlitecloud . Database ( connectionString , error => {
68+ // connect via websocket to the gateway on the same server
69+ const connectionConfig = {
70+ gatewayUrl : `${ window . location . protocol === 'https:' ? 'wss' : 'ws' } ://${ window . location . hostname } :4000` ,
71+ connectionString
72+ }
73+
74+ database = new window . sqlitecloud . Database ( connectionConfig , error => {
6975 if ( error ) {
7076 database = null
7177 appendMessage ( `connection error: ${ error } ` )
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ <h2>Messages:</h2>
111111 socket = setupSocket ( )
112112 }
113113 socket . emit ( 'v1/info' , { } , response => {
114- appendMessage ( `info | rss : ${ ( response . data . rss / 1024 / 1024 ) . toFixed ( 2 ) } mb, ${ JSON . stringify ( response ) } ` )
114+ appendMessage ( `info | heapSize : ${ ( response . data . memory . heapSize / 1024 / 1024 ) . toFixed ( 2 ) } mb, ${ JSON . stringify ( response ) } ` )
115115 } )
116116 } )
117117 </ script >
You can’t perform that action at this time.
0 commit comments