Blazing fast and lightweight PostGIS, MBtiles and PMtiles tile server, tile generation, and mbtiles tooling.
Go to file
dependabot[bot] 9f4273954e
chore(deps): Bump sqlx from 0.7.3 to 0.7.4 (#1250)
Bumps [sqlx](https://github.com/launchbadge/sqlx) from 0.7.3 to 0.7.4.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/launchbadge/sqlx/blob/main/CHANGELOG.md">sqlx's
changelog</a>.</em></p>
<blockquote>
<h2>0.7.4 - 2024-03-11</h2>
<p>38 pull requests were merged this release cycle.</p>
<p>This is officially the <strong>last</strong> release of the 0.7.x
release cycle.</p>
<p>As of this release, development of 0.8.0 has begun on
<code>main</code> and only high-priority bugfixes may be backported.</p>
<h3>Added</h3>
<ul>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/2891">#2891</a>]:
feat: expose getters for connect options fields [[<a
href="https://github.com/saiintbrisson"><code>@​saiintbrisson</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/2902">#2902</a>]:
feat: add <code>to_url_lossy</code> to connect options [[<a
href="https://github.com/lily-mosquitoes"><code>@​lily-mosquitoes</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/2927">#2927</a>]:
Support <code>query!</code> for cargo-free systems [[<a
href="https://github.com/kshramt"><code>@​kshramt</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/2997">#2997</a>]:
doc(FAQ): add entry explaining prepared statements [[<a
href="https://github.com/abonander"><code>@​abonander</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3001">#3001</a>]:
Update README to clarify MariaDB support [[<a
href="https://github.com/iangilfillan"><code>@​iangilfillan</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3004">#3004</a>]:
feat(logging): Add numeric elapsed time field elapsed_secs [[<a
href="https://github.com/iamjpotts"><code>@​iamjpotts</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3007">#3007</a>]:
feat: add <code>raw_sql</code> API [[<a
href="https://github.com/abonander"><code>@​abonander</code></a>]]
<ul>
<li>This hopefully makes it easier to find how to execute statements
which are not supported by the default
prepared statement interfaces <code>query*()</code> and
<code>query!()</code>.</li>
<li>Improved documentation across the board for the
<code>query*()</code> functions.</li>
<li>Deprecated: <code>execute_many()</code> and
<code>fetch_many()</code> on interfaces that use prepared statements.
<ul>
<li>Multiple SQL statements in one query string were only supported by
SQLite because its prepared statement
interface is the <em>only</em> way to execute SQL. All other database
flavors forbid multiple statements in
one prepared statement string as an extra defense against SQL
injection.</li>
<li>The new <code>raw_sql</code> API retains this functionality because
it explicitly does <em>not</em> use prepared statements.
Raw or text-mode query interfaces generally allow multiple statements in
one query string, and this is
supported by all current databases. Due to their nature, however, one
cannot use bind parameters with them.</li>
<li>If this change affects you, an issue is open for discussion: <a
href="https://redirect.github.com/launchbadge/sqlx/issues/3108">launchbadge/sqlx#3108</a></li>
</ul>
</li>
</ul>
</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3011">#3011</a>]:
Added support to IpAddr with MySQL/MariaDB. [[<a
href="https://github.com/Icerath"><code>@​Icerath</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3013">#3013</a>]:
Add default implementation for PgInterval [[<a
href="https://github.com/pawurb"><code>@​pawurb</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3018">#3018</a>]:
Add default implementation for PgMoney [[<a
href="https://github.com/pawurb"><code>@​pawurb</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3026">#3026</a>]:
Update docs to reflect support for MariaDB data types [[<a
href="https://github.com/iangilfillan"><code>@​iangilfillan</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3037">#3037</a>]:
feat(mysql): allow to connect with mysql driver without default behavor
[[<a
href="https://github.com/darkecho731"><code>@​darkecho731</code></a>]]</li>
</ul>
<h3>Changed</h3>
<ul>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/2900">#2900</a>]:
Show latest url to docs for macro.migrate [[<a
href="https://github.com/Vrajs16"><code>@​Vrajs16</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/2914">#2914</a>]:
Use <code>create_new</code> instead of <code>atomic-file-write</code>
[[<a
href="https://github.com/mattfbacon"><code>@​mattfbacon</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/2926">#2926</a>]:
docs: update example for <code>PgConnectOptions</code> [[<a
href="https://github.com/Fyko"><code>@​Fyko</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/2989">#2989</a>]:
sqlx-core: Remove dotenvy dependency [[<a
href="https://github.com/joshtriplett"><code>@​joshtriplett</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/2996">#2996</a>]:
chore: Update ahash to 0.8.7 [[<a
href="https://github.com/takenoko-gohan"><code>@​takenoko-gohan</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3006">#3006</a>]:
chore(deps): Replace unmaintained tempdir crate with tempfile [[<a
href="https://github.com/iamjpotts"><code>@​iamjpotts</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3008">#3008</a>]:
chore: Ignore .sqlx folder created by running ci steps locally [[<a
href="https://github.com/iamjpotts"><code>@​iamjpotts</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3009">#3009</a>]:
chore(dev-deps): Upgrade env_logger from 0.9 to 0.11 [[<a
href="https://github.com/iamjpotts"><code>@​iamjpotts</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3010">#3010</a>]:
chore(deps): Upgrade criterion to 0.5.1 [[<a
href="https://github.com/iamjpotts"><code>@​iamjpotts</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3050">#3050</a>]:
Optimize SASL auth in sqlx-postgres [[<a
href="https://github.com/mirek26"><code>@​mirek26</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3055">#3055</a>]:
Set TCP_NODELAY option on TCP sockets [[<a
href="https://github.com/mirek26"><code>@​mirek26</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3065">#3065</a>]:
Improve max_lifetime handling [[<a
href="https://github.com/mirek26"><code>@​mirek26</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3072">#3072</a>]:
Change the name of &quot;inner&quot; function generated by
<code>#[sqlx::test]</code> [[<a
href="https://github.com/ciffelia"><code>@​ciffelia</code></a>]]</li>
<li>[<a
href="https://redirect.github.com/launchbadge/sqlx/issues/3083">#3083</a>]:
Remove sha1 because it's not being used in postgres [[<a
href="https://github.com/rafaelGuerreiro"><code>@​rafaelGuerreiro</code></a>]]</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="635dba5b26"><code>635dba5</code></a>
fix: deprecation in <code>postgres::types::chrono</code></li>
<li><a
href="a2b89d70a7"><code>a2b89d7</code></a>
fix: deprecation warnings in <code>sqlite::types::chrono</code>,
document <code>DATETIME</code> beh...</li>
<li><a
href="248d6170a7"><code>248d617</code></a>
chore: prepare 0.7.4 release</li>
<li><a
href="d005111494"><code>d005111</code></a>
fix: better I/O errors when <code>migrate!()</code> cannot read a
file</li>
<li><a
href="24be262165"><code>24be262</code></a>
fix: restore <code>Migrator</code> to the public API</li>
<li><a
href="bbfd0d711a"><code>bbfd0d7</code></a>
fix: AnyRow not support PgType::Varchar (<a
href="https://redirect.github.com/launchbadge/sqlx/issues/2976">#2976</a>)</li>
<li><a
href="b29eab0439"><code>b29eab0</code></a>
feat: add <code>to_url_lossy</code> to connect options (<a
href="https://redirect.github.com/launchbadge/sqlx/issues/2902">#2902</a>)</li>
<li><a
href="34860b7f99"><code>34860b7</code></a>
fix(ci): just cfg-out the whole
<code>tests/sqlite/sqlcipher.rs</code></li>
<li><a
href="791a7f5417"><code>791a7f5</code></a>
doc(pg): document behavior of <code>bigdecimal</code> and
<code>rust_decimal</code> with out-of-ran...</li>
<li><a
href="e5c18b354e"><code>e5c18b3</code></a>
fix: gate <code>sqlcipher</code> testing behind <code>cfg</code> to make
development less annoying</li>
<li>Additional commits viewable in <a
href="https://github.com/launchbadge/sqlx/compare/v0.7.3...v0.7.4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=sqlx&package-manager=cargo&previous-version=0.7.3&new-version=0.7.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-13 02:50:29 +00:00
.cargo-husky/hooks Use --locked with cargo install (#1216) 2024-02-27 15:40:20 +08:00
.github chore(deps): Bump softprops/action-gh-release from 1 to 2 (#1239) 2024-03-09 03:16:15 -05:00
debian Implement tile caching (#1105) 2023-12-30 22:48:23 -05:00
demo Adapt justfiles for Docker Compose command (#1153) 2024-01-29 13:15:10 -05:00
docs chore: rename agg_tiles_hash_in_diff to agg_tiles_hash_after_apply (#1243) 2024-03-11 04:29:50 -04:00
martin Update lock, insta version deprecation, some test changes (#1240) 2024-03-11 01:14:27 -04:00
martin-tile-utils Fix typos (#1225) 2024-03-03 02:54:01 -05:00
mbtiles chore: rename agg_tiles_hash_in_diff to agg_tiles_hash_after_apply (#1243) 2024-03-11 04:29:50 -04:00
tests Update lock, insta version deprecation, some test changes (#1240) 2024-03-11 01:14:27 -04:00
.dockerignore Add AWS Lambda support (#1127) 2024-02-01 18:56:40 +00:00
.gitignore Add AWS Lambda support (#1127) 2024-02-01 18:56:40 +00:00
Cargo.lock chore(deps): Bump sqlx from 0.7.3 to 0.7.4 (#1250) 2024-03-13 02:50:29 +00:00
Cargo.toml chore(deps): Bump pbf_font_tools from 2.5.0 to 2.5.1 (#1191) 2024-02-13 02:59:51 +00:00
CHANGELOG.md fix spaces 2023-10-12 16:10:24 -04:00
CODE_OF_CONDUCT.md feat: clean up readme and code of conduct (#382) 2022-08-11 07:06:12 -04:00
docker-compose.yml Implement http pmtiles (#991) 2023-12-22 06:01:50 +00:00
justfile Use --locked with cargo install (#1216) 2024-02-27 15:40:20 +08:00
LICENSE-APACHE Clean up licensing per on-boarding (#364) 2022-07-06 08:25:45 -04:00
LICENSE-MIT Clean up licensing per on-boarding (#364) 2022-07-06 08:25:45 -04:00
logo.png docs: ✏️ add notes on debugging 2019-02-04 20:22:04 +03:00
README.md doc links 2023-12-25 01:49:39 -05:00
rustfmt.toml Minor refactor and cleanup (#716) 2023-06-15 18:36:41 -04:00
SECURITY_POLICY.txt Create SECURITY_POLICY.txt (#489) 2023-02-04 19:06:17 -05:00

Martin

Book docs.rs docs GitHub crates.io version Security audit CI build

Martin is a tile server able to generate and serve vector tiles on the fly from large PostGIS databases, PMTile (local or remote), and MBTile files, allowing multiple tile sources to be dynamically combined into one. Martin optimizes for speed and heavy traffic, and is written in Rust.

Additionally, there are several tools for generating tiles in bulk from any Martin-supported sources (similar to tilelive-copy), copying tiles between MBTiles files, creating deltas (patches) and applying them, and validating MBTiles files.

See Martin book for complete documentation.

Installation

See installation instructions in the Martin book.

Prerequisites: If using Martin with PostgreSQL database, you must install PostGIS with at least v3.0+, v3.1+ recommended.

You can download martin from GitHub releases page.

Platform AMD-64 ARM-64
Linux .tar.gz (gnu)
.tar.gz (musl)
.deb
.tar.gz (musl)
macOS .tar.gz .tar.gz
Windows .zip

If you are using macOS and Homebrew you can install martin and mbtiles using Homebrew tap.

brew tap maplibre/martin
brew install martin

Running Martin Service

See running instructions in the Martin book.

Martin supports any number of PostgreSQL/PostGIS database connections with geospatial-enabled tables and tile-producing SQL functions, as well as PMTile and MBTile files as tile sources.

Martin can auto-discover tables and functions using a connection string. A PG connection string can also be passed via the DATABASE_URL environment variable.

Each tile source will have a TileJSON endpoint.

Examples

# publish all tables and functions from a single database
export DATABASE_URL="postgresql://user:password@host:port/database"
martin

# same as above, but passing connection string via CLI, together with a directory of .mbtiles/.pmtiles files
martin postgresql://user:password@host:port/database path/to/dir

# publish all discovered tables/funcs from two DBs
# and generate config file with all detected sources
martin postgres://... postgres://...  --save-config config.yaml

# use configuration file instead of auto-discovery
martin --config config.yaml

Docker Example

See Docker instructions in the Martin book.

Martin is also available as a Docker image. You could either share a configuration file from the host with the container via the -v param, or you can let Martin auto-discover all sources e.g. by passing DATABASE_URL or specifying the .mbtiles/.pmtiles files.

export PGPASSWORD=postgres  # secret!
docker run -p 3000:3000 \
           -e PGPASSWORD \
           -e DATABASE_URL=postgresql://user@host:port/db \
           -v /path/to/config/dir:/config \
           ghcr.io/maplibre/martin --config /config/config.yaml

API

See API documentation in the Martin book.

Martin data is available via the HTTP GET endpoints:

URL Description
/ Status text, that will eventually show web UI
/catalog List of all sources
/{sourceID} Source TileJSON
/{sourceID}/{z}/{x}/{y} Map Tiles
/{source1},…,{sourceN} Composite Source TileJSON
/{source1},…,{sourceN}/{z}/{x}/{y} Composite Source Tiles
/sprite/{spriteID}[@2x].{json,png} Sprites (low and high DPI, index/png)
/font/{font}/{start}-{end} Font source
/font/{font1},…,{fontN}/{start}-{end} Composite Font source
/health Martin server health check: returns 200 OK

Re-use Martin as a library

Martin can be used as a standalone server, or as a library in your own Rust application. When used as a library, you can use the following features:

  • postgres - enable PostgreSQL/PostGIS tile sources
  • pmtiles - enable PMTile tile sources
  • mbtiles - enable MBTile tile sources
  • fonts - enable font sources
  • sprites - enable sprite sources

Documentation

See Martin book for complete documentation.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.