prorm API Reference
    Preparing search index...

    Class GCSStore

    Google Cloud Storage store, implementing the minimal NoSqlStore marker interface. Unlike the SQL dialects there is no query(sql) - GCS's operations are object-shaped (bucket(name).file(key).<op>()) and that shape is preserved here rather than forced into a SQL string.

    Implements

    Index
    name: "gcs" = 'gcs'

    The name of the store (e.g. 'mongodb', 'redis', 'dynamodb')

    library: "@google-cloud/storage" = '@google-cloud/storage'

    The client library being used

    • Upload (or overwrite) an object. data may be a Buffer or string; options is passed straight through to file.save() (e.g. { contentType, metadata, resumable }).

      Parameters

      • bucket: string
      • key: string
      • data: string | Buffer<ArrayBufferLike>
      • options: UploadObjectOptions = {}

      Returns Promise<void>

    • Download an object's contents as a Buffer. Throws if the object does not exist.

      Parameters

      • bucket: string
      • key: string

      Returns Promise<Buffer<ArrayBufferLike>>

    • Delete an object. Throws if the object does not exist.

      Parameters

      • bucket: string
      • key: string

      Returns Promise<void>

    • Returns whether an object exists.

      Parameters

      • bucket: string
      • key: string

      Returns Promise<boolean>

    • List objects in a bucket, optionally restricted to those whose name starts with prefix. Returns the raw File objects from the driver.

      Parameters

      • bucket: string
      • Optionalprefix: string

      Returns Promise<any[]>

    • Fetch an object's metadata (size, contentType, updated, custom metadata, etc).

      Parameters

      • bucket: string
      • key: string

      Returns Promise<Record<string, unknown>>