allow SQLite on web #956

This commit is contained in:
SPRINX0\prochazka
2025-02-27 09:26:38 +01:00
parent 1c0fc0bff2
commit a30efd6e81
3 changed files with 16 additions and 8 deletions

View File

@@ -162,7 +162,7 @@ export interface EngineDriver<TClient = any> extends FilterBehaviourProvider {
profilerTimestampFunction?: string; profilerTimestampFunction?: string;
profilerChartAggregateFunction?: string; profilerChartAggregateFunction?: string;
profilerChartMeasures?: { label: string; field: string }[]; profilerChartMeasures?: { label: string; field: string }[];
isElectronOnly?: boolean; // isElectronOnly?: boolean;
supportsTransactions?: boolean; supportsTransactions?: boolean;
implicitTransactions?: boolean; // transaction is started with first SQL command, no BEGIN TRANSACTION is needed implicitTransactions?: boolean; // transaction is started with first SQL command, no BEGIN TRANSACTION is needed

View File

@@ -93,7 +93,7 @@
{ label: '(select connection type)', value: '' }, { label: '(select connection type)', value: '' },
..._.sortBy( ..._.sortBy(
$extensions.drivers $extensions.drivers
.filter(driver => !driver.isElectronOnly || electron) // .filter(driver => !driver.isElectronOnly || electron)
.map(driver => ({ .map(driver => ({
value: driver.engine, value: driver.engine,
label: driver.title, label: driver.title,
@@ -104,11 +104,19 @@
/> />
{#if driver?.showConnectionField('databaseFile', $values, showConnectionFieldArgs)} {#if driver?.showConnectionField('databaseFile', $values, showConnectionFieldArgs)}
<FormElectronFileSelector {#if electron}
label="Database file" <FormElectronFileSelector
name="databaseFile" label="Database file"
disabled={isConnected || !electron || disabledFields.includes('databaseFile')} name="databaseFile"
/> disabled={isConnected || disabledFields.includes('databaseFile')}
/>
{:else}
<FormTextField
label="Database file (path on server)"
name="databaseFile"
disabled={isConnected || disabledFields.includes('databaseFile')}
/>
{/if}
{/if} {/if}
{#if driver?.showConnectionField('useDatabaseUrl', $values, showConnectionFieldArgs)} {#if driver?.showConnectionField('useDatabaseUrl', $values, showConnectionFieldArgs)}

View File

@@ -64,7 +64,7 @@ const driver = {
: sqliteSplitterOptions, : sqliteSplitterOptions,
// isFileDatabase: true, // isFileDatabase: true,
isElectronOnly: true, // isElectronOnly: true,
predefinedDataTypes: ['integer', 'real', 'text', 'blob'], predefinedDataTypes: ['integer', 'real', 'text', 'blob'],
}; };