newShadertoySqliteMemoryStore function Null safety

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

Creates a ShadertoyStore backed by a in-memory ShadertoySqliteStore

  • 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

Implementation

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

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