9f4273954e
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 "inner" 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=" |
||
---|---|---|
.cargo-husky/hooks | ||
.github | ||
debian | ||
demo | ||
docs | ||
martin | ||
martin-tile-utils | ||
mbtiles | ||
tests | ||
.dockerignore | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
docker-compose.yml | ||
justfile | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
logo.png | ||
README.md | ||
rustfmt.toml | ||
SECURITY_POLICY.txt |
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
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
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.