Playing Next Lesson In
seconds

Let's Learn AdonisJS 6 #4.17

Generating A Unique Movie Slug With Model Hooks

In This Lesson

We'll learn how we can use Model Hooks to generate a unique URL-safe slug based on the movie's title.

Created by
@tomgobich
Published

Join the Discussion 2 comments

Create a free account to join in on the discussion
  1. @e4ma

    After implementing slugify hook, I got an error, when refreshing my database, from the seeders. I use sqlite for database. The refresh and start_seeder passed well, but not the fake_seeder, and I get : Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? as error.
    To fix it (after searching), I added pool: {min: 0, max: 30, idleTimeoutMillis: 600000,} in config/database.ts, just after client: 'better-sqlite3', probably not the best solution.

    3
    1. Responding to e4ma
      @tomgobich

      Hi e4ma! I'm not all that familiar with SQLite, but if its default limit is a single connection or two, then that very well could've been the actual cause of your issue. This type of error can also occur due to a lingering SQL operation or a transaction that was left open.

      0