Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

trilogy

> 编程语言
Open source

Trilogy is a client library for MySQL-compatible database servers, designed for performance, flexibility, and ease of embedding.

784 stars0 likes0 views
WebsiteGitHub

About

Trilogy is a client library for MySQL-compatible database servers, designed for performance, flexibility, and ease of embedding.

Trilogy

Trilogy is a client library for MySQL-compatible database servers, designed for performance, flexibility, and ease of embedding.

It's currently in production use on github.com.

Features

  • Supports the most frequently used parts of the text protocol

    • Handshake
    • Password authentication
    • Query, ping, and quit commands
  • Support prepared statements (binary protocol)

  • Low-level protocol API completely decoupled from IO

  • Non-blocking client API wrapping the protocol API

  • Blocking client API wrapping the non-blocking API

  • No dependencies outside of POSIX, the C standard library & OpenSSL

  • Minimal dynamic allocation

  • MIT licensed

Limitations

  • Only supports the parts of the text protocol that are in common use.

  • No support for LOAD DATA INFILE on local files

  • trilogy_escape assumes an ASCII-compatible connection encoding

Building

make - that's it. This will build a static libtrilogy.a

Trilogy should build out of the box on most UNIX systems which have OpenSSL installed.

API Documentation

Documentation for Trilogy's various APIs can be found in these header files:

  • blocking.h

    The blocking client API. These are simply a set of convenient wrapper functions around the non-blocking client API in client.h

  • client.h

    The non-blocking client API. Every command is split into a _send and _recv function allowing callers to wait for IO readiness externally to Trilogy

  • builder.h

    MySQL-compatible packet builder API

  • charset.h

    Character set and encoding tables

  • error.h

    Error table. Every Trilogy function returning an int uses the error codes defined here

  • packet_parser.h

    Streaming packet frame parser

  • protocol.h

    Low-level protocol API. Provides IO-decoupled functions to parse and build packets

  • reader.h

    Bounds-checked packet reader API

Bindings

We maintain a Ruby binding in this repository. This is currently stable and production-ready.

License

Trilogy is released under the MIT license.

Issues· 21 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言