newShadertoySqliteLocalStore function Null safety

Future<ShadertoyStore> newShadertoySqliteLocalStore(
  1. {String? path,
  2. bool? foreignKeysEnabled,
  3. bool? logStatementsEnabled,
  4. WebBackend? webBackend,
  5. String? sqliteWasmPath,
  6. int? shaderCount,
  7. int? userShaderCount,
  8. int? playlistShaderCount,
  9. ErrorMode? errorHandling}

Creates a ShadertoyStore backed by a local ShadertoySqliteStore

  • path: The path to the database
  • foreignKeysEnabled: If the foreign keys are enabled
  • logStatementsEnabled: If true (defaults to false), generated sql statements will be printed before executing.
  • webBackend: The web backend to use
  • sqliteWasmPath: The sqlite wasm path for the wasm backend
  • shaderCount: The number of shaders requested for a paged call
  • userShaderCount: The number of shaders requested for a user paged call
  • playlistShaderCount: The number of shaders requested for a playlist paged call
  • errorHandling: The error handling mode


Future<ShadertoyStore> newShadertoySqliteLocalStore(
    {String? path,
    bool? foreignKeysEnabled,
    bool? logStatementsEnabled,
    WebBackend? webBackend,
    String? sqliteWasmPath,
    int? shaderCount,
    int? userShaderCount,
    int? playlistShaderCount,
    ErrorMode? errorHandling}) async {
  final options = getOptions(
      path: path,
      foreignKeysEnabled: foreignKeysEnabled,
      logStatementsEnabled: logStatementsEnabled,
      webBackend: webBackend,
      sqliteWasmPath: sqliteWasmPath,
      shaderCount: shaderCount,
      userShaderCount: userShaderCount,
      playlistShaderCount: playlistShaderCount,
      errorHandling: errorHandling);

  return localExecutor(options)
      .then((executor) => _newStore(executor, options))
      .then((store) => ShadertoySqliteStore(store, options));