# Knex.js vs MyBatis

**Leader by Vioscale score:** Knex.js

| Attribute | Knex.js | MyBatis |
|---|---|---|
| **Vioscale score** | 66.2 (71% (medium)) | 60.4 (42% (low)) |
| activity.commits_last_30d | 0 | 52 |
| adoption.dependent_repos | 94,868 | 87,034 |
| adoption.github_stars | 20,342 | 20,439 |
| adoption.package_downloads_weekly | 5,289,407 | - |
| description.long | An open-source Node.js package supporting nine SQL databases including PostgreSQL, MySQL, SQLite, and Oracle. Provides type-safe query building with TypeScript support, schema migrations, transaction handling with savepoints, connection pooling, and both promise and callback-based interfaces. | MyBatis is a Java framework that simplifies interaction with relational databases by allowing developers to write custom SQL and stored procedures while automatically mapping query results to Java objects, reducing boilerplate JDBC code. |
| features.capabilities | `{"raw_sql":true,"multi_db":true,"languages":"JavaScript, TypeScript","relations":true,"migrations":true,"studio_gui":false,"schema_first":true,"type_safe_queries":true,"connection_pooling":true}` | `{"raw_sql":true,"multi_db":true,"languages":"Java","relations":true}` |
| language.primary | JavaScript | Java |
| license.spdx | MIT | Apache-2.0 |
| pricing | `{"type":"open_source","sourceUrl":"https://knexjs.org","retrievedAt":"2026-08-14T08:34:17.530Z"}` | `{"type":"open_source","sourceUrl":"https://mybatis.org/mybatis-3","retrievedAt":"2026-08-14T08:36:59.708Z"}` |
| pricing.free_tier | - | yes |
| pricing.model | open_source | open_source |
| pricing.price_level | free | free |
| release.cadence_days | 28 | 112 |
| release.history | `[{"url":"https://github.com/knex/knex/releases/tag/3.3.0","date":"2026-06-26T14:55:58Z","type":"stable","version":"3.3.0"},{"url":"https://github.com/knex/knex/releases/tag/3.2.10","date":"2026-05-02T12:14:38Z","type":"stable","version":"3.2.10"},{"url":"https://github.com/knex/knex/releases/tag/3.2.9","date":"2026-04-03T20:25:30Z","type":"stable","version":"3.2.9"},{"url":"https://github.com/knex/knex/releases/tag/3.2.8","date":"2026-03-30T18:29:09Z","type":"stable","version":"3.2.8"},{"url":"https://github.com/knex/knex/releases/tag/3.2.7","date":"2026-03-30T18:28:52Z","type":"stable","version":"3.2.7"},{"url":"https://github.com/knex/knex/releases/tag/3.2.6","date":"2026-03-25T02:06:50Z","type":"stable","version":"3.2.6"},{"url":"https://github.com/knex/knex/releases/tag/3.2.3","date":"2026-03-22T22:38:07Z","type":"stable","version":"3.2.3"},{"url":"https://github.com/knex/knex/releases/tag/3.2.1","date":"2026-03-22T21:08:27Z","type":"stable","version":"3.2.1"},{"url":"https://github.com/knex/knex/releases/tag/3.2.0","date":"2026-03-22T17:37:15Z","type":"stable","version":"3.2.0"},{"url":"https://github.com/knex/knex/releases/tag/3.1.0","date":"2023-12-07T23:17:57Z","type":"stable","version":"3.1.0"},{"url":"https://github.com/knex/knex/releases/tag/3.0.1","date":"2023-10-06T12:23:40Z","type":"stable","version":"3.0.1"},{"url":"https://github.com/knex/knex/releases/tag/3.0.0","date":"2023-10-06T06:56:38Z","type":"stable","version":"3.0.0"},{"url":"https://github.com/knex/knex/releases/tag/2.5.1","date":"2023-07-12T21:26:26Z","type":"stable","version":"2.5.1"},{"url":"https://github.com/knex/knex/releases/tag/2.5.0","date":"2023-07-08T21:04:46Z","type":"stable","version":"2.5.0"},{"url":"https://github.com/knex/knex/releases/tag/2.4.2","date":"2023-03-29T11:15:20Z","type":"stable","version":"2.4.2"},{"url":"https://github.com/knex/knex/releases/tag/2.4.1","date":"2023-03-29T11:11:39Z","type":"stable","version":"2.4.1"},{"url":"https://github.com/knex/knex/releases/tag/2.4.0","date":"2023-01-06T15:45:16Z","type":"stable","version":"2.4.0"},{"url":"https://github.com/knex/knex/releases/tag/2.3.0","date":"2022-09-01T21:17:24Z","type":"stable","version":"2.3.0"},{"url":"https://github.com/knex/knex/releases/tag/2.2.0","date":"2022-07-18T21:26:26Z","type":"stable","version":"2.2.0"},{"url":"https://github.com/knex/knex/releases/tag/2.1.0","date":"2022-05-26T09:04:03Z","type":"stable","version":"2.1.0"}]` | `[{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.19","date":"2025-01-02T20:39:24Z","type":"stable","version":"mybatis-3.5.19"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.18","date":"2025-01-01T03:46:10Z","type":"stable","version":"mybatis-3.5.18"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.17","date":"2024-11-26T16:55:48Z","type":"stable","version":"mybatis-3.5.17"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.16","date":"2024-04-04T10:26:25Z","type":"stable","version":"mybatis-3.5.16"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.15","date":"2023-12-14T06:41:30Z","type":"stable","version":"mybatis-3.5.15"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.14","date":"2023-11-03T06:27:55Z","type":"stable","version":"mybatis-3.5.14"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.13","date":"2023-03-11T12:15:16Z","type":"stable","version":"mybatis-3.5.13"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.12","date":"2023-03-01T04:17:16Z","type":"stable","version":"mybatis-3.5.12"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.11","date":"2022-09-18T21:22:32Z","type":"stable","version":"mybatis-3.5.11"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.10","date":"2022-05-23T20:35:51Z","type":"stable","version":"mybatis-3.5.10"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.9","date":"2021-12-25T19:16:08Z","type":"stable","version":"mybatis-3.5.9"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.8","date":"2021-12-12T18:19:57Z","type":"stable","version":"mybatis-3.5.8"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.7","date":"2021-04-26T10:49:16Z","type":"stable","version":"mybatis-3.5.7"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.6","date":"2020-10-06T20:57:52Z","type":"stable","version":"mybatis-3.5.6"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.5","date":"2020-06-04T15:39:59Z","type":"stable","version":"mybatis-3.5.5"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.4","date":"2020-02-03T01:47:26Z","type":"stable","version":"mybatis-3.5.4"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.3","date":"2019-10-20T11:21:16Z","type":"stable","version":"mybatis-3.5.3"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.2","date":"2019-07-15T07:49:38Z","type":"stable","version":"mybatis-3.5.2"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.1","date":"2019-04-07T11:26:32Z","type":"stable","version":"mybatis-3.5.1"},{"url":"https://github.com/mybatis/mybatis-3/releases/tag/mybatis-3.5.0","date":"2019-01-20T18:13:18Z","type":"stable","version":"mybatis-3.5.0"}]` |
| reliability.status_page | - | yes |
| security.scorecard | 5.7 | 6.1 |
| security.vulnerabilities | `{"count":2,"source":"https://advisories.ecosyste.ms/api/v1/advisories?ecosystem=npm&package_name=knex&per_page=100","last_12m":0,"max_severity":"CRITICAL"}` | `{"count":1,"source":"https://advisories.ecosyste.ms/api/v1/advisories?ecosystem=maven&package_name=org.mybatis%3Amybatis&per_page=100","last_12m":0,"max_severity":"HIGH"}` |

## Capabilities (ORM & Database Tools)

| Capability | Knex.js | MyBatis |
|---|:--:|:--:|
| **Core** |  |  |
| Type-safe queries | ✓ | - |
| Schema migrations | ✓ | - |
| Relations / joins API | ✓ | ✓ |
| Languages | JavaScript, TypeScript | Java |
| **Modelling** |  |  |
| Schema-first modelling | ✓ | - |
| **Flexibility** |  |  |
| Raw SQL escape hatch | ✓ | ✓ |
| **Portability** |  |  |
| Multiple database backends | ✓ | ✓ |
| **Ops** |  |  |
| Connection pooling | ✓ | - |
| **DX** |  |  |
| Data browser / studio | ✗ | - |

*Source: Vioscale. Generated 2026-09-01T17:07:50.973Z. "-" = undocumented, not absent.*
