Playing Next Lesson In
seconds

Let's Learn AdonisJS 6 #4.0

Configuring Lucid and our Database Connection

In This Lesson

We'll learn how we can configure Lucid to use a different driver other than SQLite; PostgreSQL is shown but MySQL and MSSQL are much the same. Then, we'll set up our connection details so that we can successfully connect to our database.

Created by
@tomgobich
Published

Join the Discussion 4 comments

Create a free account to join in on the discussion
  1. Hi,

    First, thank you for your video ! That's very clear.
    around 2:20, you say "within the second lesson of this series, we went through and used pgadmin to create new table" … But I've been doing the whole "second lesson" but I did not see when we used pgadmin in here. Did I miss something ? Were can I find the tutorial were you set up the database ?

    thanks

    1
    1. Responding to pierrick-chauvet
      @tomgobich

      Hi Pierrick, thank you for watching!

      You can find this within lesson 1.1 - "What We'll Need Before We Begin." At the 3:10 mark, we created the database "adonis6" for use in this series, I apologize; it seems I misspoke and said table in this lesson when I meant database.

      1
  2. @n2zb

    Hi Tom,
    I usually work with SQLite or Postgres, but I was wondering if there was a way to work with a NoSQL solution (like Firebase) on Adonis since Lucid seems to be a SQL-only builder?

    1
    1. Responding to n2zb
      @tomgobich

      Hi n2zb! Yeah, absolutely! I haven't done it myself, but it is definitely possible. AdonisJS is still using NodeJS at the end of the day, so you could use Firebase's NodeJS SDK so long as it works with NodeJS v20 or later & supports ESM.

      Now - it won't work out of the box with a few AdonisJS packages that rely on Lucid, like:

      • Auth - though it can be configured with a custom guard

      • Bouncer

      • Limiter - though it'd work with Redis

      • Likely others

      1