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.

Published
Mar 15
Duration
7m 59s

Developer, dog lover, and burrito eater. Currently teaching AdonisJS, a fully featured NodeJS framework, and running Adocasts where I post new lessons weekly. Professionally, I work with JavaScript, .Net C#, and SQL Server.

Adocasts

Burlington, KY

Join The Discussion! (1 Comments)

Please sign in or sign up for free to join in on the dicussion.

  1. Commented 16 hours ago

    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.

    0

    Please sign in or sign up for free to reply