File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import type { Customer } from ' $lib/server/db' ;
23 import { runQuery } from ' $lib/sqlite/dataApi' ;
34 import { waitTillStroageReady } from ' $lib/sqlite/initStorages' ;
45 import { onMount } from ' svelte' ;
56
67 let storageReady = false ;
8+ let customers: Customer [] = [];
79
810 onMount (async () => {
911 await waitTillStroageReady (' customers_v1' );
1012 storageReady = true ;
11- const data = await runQuery (` update customers_v1 set company = 'xyz' where 1 = 1 ` );
12- console .log (data );
13- const data2 = await runQuery (' SELECT * FROM customers_v1 limit 10' );
14- console .log (data2 );
13+ customers = (await runQuery (' SELECT * FROM customers_v1 limit 10' )) as Customer [];
14+ console .log (customers );
1515 });
1616 </script >
1717
2020<div >
2121 Storage Ready: {storageReady ? ' true' : ' false' }
2222</div >
23+
24+ <div >
25+ {#each customers as customer }
26+ <div >
27+ {customer .company }: Contact: {customer .contact } - {customer .phone }
28+ </div >
29+ {/each }
30+ </div >
You can’t perform that action at this time.
0 commit comments