Mbtiles.DB.Queries (mbtiles v0.4.0)

This module defines functions for queries in queries.sql

Link to this section Summary

Functions

Gets all of metadata.

Gets all of metadata.. On error, fails (See function without bang for more information).

Selects a single tile from database.

Selects a single tile from database.. On error, fails (See function without bang for more information).

Runs the query.

Runs the query. On error, fails.

Link to this section Functions

Link to this function

get_metadata(params, options \\ [])

Specs

get_metadata(AyeSQL.Core.parameters(), AyeSQL.Core.options()) ::
  {:ok, AyeSQL.Query.t() | term()} | {:error, AyeSQL.Error.t() | term()}

Gets all of metadata.

Expected params are:

[]

with the following options:

  • run? - Whether it should run the query or not. Defaults to true.

and generates/runs the query:

SELECT   *   FROM   metadata
Link to this function

get_metadata!(params, options \\ [])

Specs

Gets all of metadata.. On error, fails (See function without bang for more information).

Link to this function

get_tile(params, options \\ [])

Specs

get_tile(AyeSQL.Core.parameters(), AyeSQL.Core.options()) ::
  {:ok, AyeSQL.Query.t() | term()} | {:error, AyeSQL.Error.t() | term()}

Selects a single tile from database.

Expected params are:

[:zoom, :x, :y]

with the following options:

  • run? - Whether it should run the query or not. Defaults to true.

and generates/runs the query:

SELECT   tile_data   FROM   tiles   where   zoom_level   =   :zoom   and   tile_column   =   :x   and   tile_row   =   :y
Link to this function

get_tile!(params, options \\ [])

Specs

Selects a single tile from database.. On error, fails (See function without bang for more information).

Link to this function

run(query, options \\ [])

Specs

run(AyeSQL.Query.t(), keyword()) :: {:ok, term()} | {:error, term()}

Runs the query.

Link to this function

run!(query, options \\ [])

Specs

run!(AyeSQL.Query.t(), keyword()) :: term() | no_return()

Runs the query. On error, fails.