{
 "kind": "tool",
 "slug": "knex",
 "path": "tools/knex/",
 "name": "Knex.js",
 "maker": null,
 "density": "basic",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Databases, ORMs and clients",
   "tools/databases-orms/"
  ]
 ],
 "lead": "SQL query and schema builder for Postgres, MySQL, SQLite and more.",
 "chips": [
  {
   "label": "Databases, ORMs and clients",
   "path": "tools/databases-orms/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install knex"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/knex/knex"
  },
  {
   "label": "Website",
   "href": "https://knexjs.org/"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/knex/knex"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Jun 26, 2026",
   "note": "Latest GitHub release Jun 26, 2026. ",
   "src": "https://github.com/knex/knex"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "7 projects",
   "status": "info",
   "sub": "#49 of 120 in its category",
   "note": "Dependency in 7 public GitHub projects set up for AI coding agents that we scanned (0.1%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Knex.js does",
   "parts": [
    {
     "t": "prose",
     "text": "SQL query and schema builder for Postgres, MySQL, SQLite and more."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Knex.js popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "61",
       "of": "/ 100",
       "l": "Gid Score, #974 overall"
      },
      {
       "n": "7.3M",
       "l": "downloads a week, npm"
      },
      {
       "n": "20.3K",
       "l": "GitHub stars"
      },
      {
       "n": "7",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Knex.js is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "Knex.js joined the catalog on its public numbers (7,260,732 downloads a week on npm and 20,336 GitHub stars), not on our project count: it is a dependency in 19 public GitHub projects of our scan, 7 of them set up for AI coding agents.",
      "The most used alternative in our scan is Drizzle ORM (253 projects).",
      "Projects that use it most often also use pg (73.7%), dotenv (68.4%), Express (47.4%)."
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 73.7% of its projects",
       "v": "pg",
       "path": "tools/pg/"
      },
      {
       "l": "In 68.4% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 47.4% of its projects",
       "v": "Express",
       "path": "tools/express/"
      },
      {
       "l": "In 42.1% of its projects",
       "v": "better-sqlite3",
       "path": "tools/better-sqlite3/"
      },
      {
       "l": "In 36.8% of its projects",
       "v": "concurrently",
       "path": "tools/concurrently/"
      },
      {
       "l": "In 36.8% of its projects",
       "v": "ts-node",
       "path": "tools/ts-node/"
      },
      {
       "l": "In 31.6% of its projects",
       "v": "Axios",
       "path": "tools/axios/"
      },
      {
       "l": "In 31.6% of its projects",
       "v": "sqlite3",
       "path": "tools/sqlite3/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about Knex.js",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "More in Databases, ORMs and clients",
       "path": "tools/databases-orms/",
       "items": [
        {
         "text": "pg",
         "path": "tools/pg/"
        },
        {
         "text": "Drizzle Kit",
         "path": "tools/drizzle-kit/"
        },
        {
         "text": "SQLAlchemy",
         "path": "tools/sqlalchemy/"
        },
        {
         "text": "better-sqlite3",
         "path": "tools/better-sqlite3/"
        },
        {
         "text": "psycopg2",
         "path": "tools/psycopg2-binary/"
        },
        {
         "text": "Alembic",
         "path": "tools/alembic/"
        },
        {
         "text": "Neon Serverless Driver",
         "path": "tools/neondatabase/"
        },
        {
         "text": "psycopg",
         "path": "tools/psycopg/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Knex.js",
       "me": true,
       "facts": [
        "MIT",
        "Gid 61",
        "7.3M/wk"
       ]
      },
      {
       "name": "Drizzle ORM",
       "why": "TypeScript ORM for SQL databases with type safety and zero-runtime overhead.",
       "path": "tools/drizzle-orm/",
       "facts": [
        "Apache-2.0",
        "Gid 86",
        "49.6M/wk"
       ]
      },
      {
       "name": "Prisma",
       "why": "Modern ORM with intuitive schema, migrations, and type-safe database queries.",
       "path": "tools/prisma/",
       "facts": [
        "Apache-2.0",
        "Gid 64",
        "26M/wk"
       ]
      }
     ],
     "more": "Compare Knex.js with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install knex"
    },
    {
     "t": "gap",
     "text": "No step-by-step start for Knex.js yet: we have not written its hand-checked card."
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm knex"
  ],
  [
   "Category",
   "Databases, ORMs and clients"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "60.7"
  ],
  [
   "Rank in category",
   "#49 of 120"
  ],
  [
   "GitHub",
   "knex/knex"
  ],
  [
   "Last change",
   "Jun 26, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/knex.png"
}