Node JS SQLite Crash Course

Поділитися
Вставка
  • Опубліковано 4 жов 2024

КОМЕНТАРІ • 102

  • @bytemyke
    @bytemyke  8 місяців тому +3

    Written tutorial and GitHub source code : bytemyke.com/blog/how-to-use-sqlite-in-node-js/

  • @almamunroni8593
    @almamunroni8593 2 роки тому +7

    For the first time, i have learned something about Sqlite only for your video content, thanks a lot

  • @yajirushik2871
    @yajirushik2871 2 роки тому +10

    You got like instantly ^^! Really Thank You, daily I'm working with front-end but my friend asked for help with full-stack app. I just have spend 3 days with learning docs and searching. This video saved my mental health and weeks of learning. You are the best 🚀

    • @bytemyke
      @bytemyke  2 роки тому +4

      Glad I could help! Good luck with the app

  • @arv_is
    @arv_is 8 місяців тому +4

    I've worked with many different databases and have experience, but didn't know how it works in node ( been learning node for 2 hours total :D ).
    After you showed how to make a query and execute it I left the video, but wanted to thank you for making it simple and not going on for 40 minutes.

    • @bytemyke
      @bytemyke  8 місяців тому +1

      Glad it helped!

  • @hszt4414
    @hszt4414 2 роки тому +5

    and again, best SQL JS tutorial out there, few extra thing compared to "blurry" version !
    Thanks again!

  • @evertdeboer
    @evertdeboer Рік тому +3

    Thanks for the great tutorials, especially the pace! Some others try to break speed records, apparently. You give us time to digest your excellent content!

  • @xhurricane9
    @xhurricane9 2 місяці тому +1

    Super useful, No yapping, Keep up the great work brother

  • @Smileeee_23
    @Smileeee_23 Рік тому +1

    Thank you I'm from Venezuela and I couldn't find tutorials on this topic in Spanish, really thank you very much

  • @shadow_1363
    @shadow_1363 7 місяців тому +2

    Incredible tutorial, subbed!

    • @bytemyke
      @bytemyke  7 місяців тому +1

      Thank you!

  • @Filaxsan
    @Filaxsan 5 місяців тому +2

    Yo! Thanks Myke! Easy and to the point, keep it up 💪

    • @bytemyke
      @bytemyke  5 місяців тому +2

      Thanks! Will do!

  • @duchieu5863
    @duchieu5863 Рік тому +1

    Dude, thanks! Now i can store data no using Json :))

  • @SheelByTorn
    @SheelByTorn 2 роки тому +6

    I need this for our software engineering 1 subject this semester.
    nice timing😍

    • @bytemyke
      @bytemyke  2 роки тому +2

      Glad I could help! I have a BS in CS and UA-cam got me though it haha

  • @mehmetsunguralp5509
    @mehmetsunguralp5509 Рік тому +2

    Very clear and direct to the point! Thanks a lot.

  • @Khalid-sr4zo
    @Khalid-sr4zo 4 місяці тому +1

    commenting for the algorithm! and of course thank you!!

  • @eugenelewis8727
    @eugenelewis8727 Місяць тому +1

    Great job, Thank you. Watched another tutorial which was not as eventful. Only issue encountered was npm i sqlite3 deprecated error. replaced with npm install sqlite3.

  • @cassidymcgee5817
    @cassidymcgee5817 2 роки тому +3

    Great video! Super helpful!

  • @SeekIntel
    @SeekIntel 2 роки тому +2

    mike! u the best keep it up man!

  • @MEGAFOXTERRIER
    @MEGAFOXTERRIER 2 роки тому

    Just what I was looking for, thanks!

  • @joaooliveira9840
    @joaooliveira9840 Рік тому +1

    Great video. Thanks a lot!

  • @fabricioitajuba
    @fabricioitajuba 4 місяці тому +1

    Thanks Myke!!!

  • @tech_kollo
    @tech_kollo Рік тому

    I'm really thankful for this video. This great help lead me to my mental relaxation 😅

  • @pyyrr
    @pyyrr Рік тому

    thanks for the vid, finally shows how to use it.

  • @ИванПетров-ф3я3щ
    @ИванПетров-ф3я3щ 11 місяців тому +1

    Super!!! 🎉
    Thank you!!!!

    • @bytemyke
      @bytemyke  11 місяців тому

      Welcome 😊

  • @drpx2880
    @drpx2880 Рік тому

    awesome content, very helpful and straight to the point! keep up the good work

  • @ticTHEhero
    @ticTHEhero Рік тому

    thanks man, very useful, keep up the goodwork

  • @WaqarRashid
    @WaqarRashid 2 роки тому +2

    Great tutorial. Would be nice to have a gist for the final source code

  • @ayaanshd
    @ayaanshd 2 роки тому +2

    this made it super easy! but i've got a question
    let's say if my database was full of stuff, how would i go about searching for a specific user in the database?

    • @bytemyke
      @bytemyke  2 роки тому

      You would want to use a WHERE clause in a select query. I have a full in depth video covering WHERE clauses in SQLITE here : ua-cam.com/video/7AtIjM6_EM8/v-deo.html
      The clause would look something like this:
      "SELECT insertColumnName/s FROM insertTableName WHERE user = insertUserData"
      Please let me know if further help is needed after watching that video :)

  • @Eihell
    @Eihell Рік тому

    thanks man, can you up the volume in the coming videos? that would be really better ;)

  • @dominikilja
    @dominikilja Рік тому

    Good stuff my friend!

  • @leanrepetitor
    @leanrepetitor Рік тому +1

    thanks you very much :D

  • @pasademix
    @pasademix Рік тому

    Ты очень крут, спасибо за эти видео😍

  • @ershe
    @ershe 10 місяців тому +1

    How difficult would this be without node/npm? Great tutorial, thank you.

    • @bytemyke
      @bytemyke  10 місяців тому

      Glad you enjoyed it! This would essentially be impossible without node, or another JavaScript runtime environment such as bun or deno. These environments are what allow us to run JavaScript outside of the browser. This could easily be done without NPM if you download the package manually and link to it in your main file. If you mean without using the library at all though, that would be extremely difficult and time consuming as you'd have to create your own which would suck haha

  • @goodluckoriuwa1669
    @goodluckoriuwa1669 5 місяців тому

    Please would you do a video on how to upload a whole folder with files to AWS s3 bucket with the version 3 using node js

  • @ericvandruten
    @ericvandruten Рік тому

    hey Mike, quick tip, because I noticed that the audio (your voice) is barely audible compared to almost every other video on youtube: use a little bit of compression to boost the audio, or use some 'Normalize' processing. This should help tremendously.

  • @rodhash
    @rodhash 4 місяці тому

    Thanks dude, amazing vid .. liked + sub .. I just was not sure why you use template literals instead of simple quotes or even double quotes

  • @luciusrex
    @luciusrex 5 днів тому

    Nice thanks!

  • @워터프루프
    @워터프루프 Рік тому

    필요한 강의였어요 추천합니다

  • @chaymajebri6670
    @chaymajebri6670 10 місяців тому

    Please how to use JDBC for sqlite in VSCode

  • @matteomontanari2960
    @matteomontanari2960 2 роки тому +1

    Hello Mike, that was a great video! I want to build a project but don't know where to start. Having my own local database file (SQLite) I want to develop a web app just to display the database. (I also want to draw some graphs based on that database on the web app, but let's take it step by step). Where i should start? Right after this comment i am going to check you u have got any tutorials on that. Thanks in advance Mike

    • @bytemyke
      @bytemyke  2 роки тому +1

      Hey Matteo! This video is a great place to start. To make it simple I'll break it up into a few sections that you'll want to learn to build the full app
      Backend:
      1. Working with sqlite
      - learn how to set up a database, insert, delete, retrieve, and retrieve with a filter
      2. Creating the API / ROUTES. This video will be helpful for SQLite and Node JS routes ua-cam.com/video/mnH_1YGR2PM/v-deo.html
      - You'll need a GET route that does a select all and ideally have a way to filter, see how I do it via query parameters in that video
      - If you want to store data in the database as well via a form or something on the front end, you will also need a POST route
      Frontend:
      1. Create the basic form or whatever that handles filtering, and do some kind of GET request to the API
      2. Grab the response from the get request and turn it into a graph. I recommend checking out chart.js if you're using vanilla js www.chartjs.org/
      Hopefully this helped! Let me know if you have any other questions

  • @codelab_channel
    @codelab_channel 2 роки тому +1

    Thank you, like🙂

  • @InfectedEnnui
    @InfectedEnnui 2 роки тому +1

    why sqlite3 instead of sqlite.js?

  • @rktechworld470
    @rktechworld470 Рік тому

    you created the database wright test.db if i want to acess the that same database in my system how we can connect

  • @davidegallo3879
    @davidegallo3879 2 роки тому +2

    Hi, thanks for the video... I needed it.
    But I was wondering, how can I use the queries with values from forms in html?
    I'm struggling to understand this method. I know how to do in PHP, with $_POST and the other methods, but I need to do the same thing in JS.
    Have you any advice or any video or maybe a web site when they teach about it?
    Thank you again.

    • @bytemyke
      @bytemyke  2 роки тому +1

      If you are using Express, which I highly recommend using. You want to grab it using the request variable in the post method. Here is an example where I use express and postman ua-cam.com/video/mnH_1YGR2PM/v-deo.html . Here is an online example nodejs.dev/learn/get-http-request-body-data-using-nodejs

  • @tosinolugbenga2904
    @tosinolugbenga2904 Рік тому +1

    I got this error SQLITE_CANTOPEN, unable to open database file

  • @chou5056
    @chou5056 Рік тому +1

    How do you make it visual? like a Delete button
    or add button

    • @bytemyke
      @bytemyke  Рік тому

      You would need to set up a frontend connected to it using either html/javascript/css, or a popular front end framework like react or vue. This video only covers the backend

  • @Buusifer
    @Buusifer 2 роки тому +1

    How can I pass a html option value into the ‘?’ SQL select statement?

    • @bytemyke
      @bytemyke  2 роки тому

      You'll want to use an HTML form that POSTS the data or post it via JavaScript (frontend). Then set up a route in Node js express. Here is an example where I set up a route ua-cam.com/video/mnH_1YGR2PM/v-deo.html . You would just use a form or JavaScript instead of postman

  • @lamborghinicentenario2497
    @lamborghinicentenario2497 6 місяців тому +1

    How do I fix "no such table: xxxxx"? The table exists I'm sure

    • @bytemyke
      @bytemyke  6 місяців тому

      If you're getting that error, then you likely either did not create the table by successfully running the "CREATE TABLE xxx" sql, or you have a typo in the table name. This typo could be in the create table sql or where you are currently trying to use it. I recommend looking at my source code and comparing it to yours.

  • @goodluckoriuwa1669
    @goodluckoriuwa1669 5 місяців тому

    What is the efficient gui for SQLite db

  • @cyraxvisuals6203
    @cyraxvisuals6203 Рік тому

    Do you know how to create a PATCH route that would allow you to edit an entry from the database and display it in the HTML?

  • @tiernanj663
    @tiernanj663 Рік тому

    Trying to create a website that allows users to upload images, stores those images in a database, and creates a new website url with a unique tag for the image. That way a user can go to that website to view their uploaded image. Lost on where to start, any advice?

  • @IlluminatiTransmissions
    @IlluminatiTransmissions Рік тому

    What does the ".verbose" do at the end of your packing requirement? I took an online course for NPM and sqlite3, but honestly, they were trash. The course didn't include the second and third arguments in your DB creation, as well as not using the verbose option when requiring sqlite3. Can you quickly explain?

  • @Mimi127
    @Mimi127 Рік тому

    Is there a way to make models for the sqlite database for bigger projects?

  • @geoking1907
    @geoking1907 2 роки тому +1

    Thanks!

    • @bytemyke
      @bytemyke  2 роки тому

      Of course! Thanks for watching!

  • @oscarfelix7244
    @oscarfelix7244 2 роки тому

    Thanks dude

  • @victorvanmassenhove4825
    @victorvanmassenhove4825 Рік тому

    is there any need to 'commit' the changes or does the db.run function directly commits the changes to the database when called?

  • @goodluckoriuwa1669
    @goodluckoriuwa1669 5 місяців тому

    I have a question... What type of db is the SQLite??? Is it one if the personal database

    • @bytemyke
      @bytemyke  5 місяців тому

      SQLite is an sql database that takes the form of a file. To be exact it is an embedded file-based relational database management system.

  • @goodluckoriuwa1669
    @goodluckoriuwa1669 5 місяців тому +1

    Do you know any free gui tool fo SQLite... I mean for ever free gui tool that we can install on windows 10 desktops or mac or lonix machines

    • @bytemyke
      @bytemyke  5 місяців тому

      I'm sorry, I do not know of such a tool. I have been thinking of making a browser based GUI tool for sqlite, would that be of interest to you?

    • @goodluckoriuwa1669
      @goodluckoriuwa1669 5 місяців тому

      @@bytemyke Okay will be waiting for that... let see how that can really help.... How long have you been using sqlite?

    • @goodluckoriuwa1669
      @goodluckoriuwa1669 5 місяців тому

      can we get closer on social media?? perhaps whatsapp or instagram?

    • @bytemyke
      @bytemyke  5 місяців тому

      @@goodluckoriuwa1669 Sure! I have my linkedin in my youtube profile if you would like to connect with me there.

  • @allsunday1485
    @allsunday1485 2 роки тому

    why is the data you log into the terminal formatted? @8:00 ?

    • @reddit3180
      @reddit3180 2 роки тому

      He must have installed auto formatter vs code extension

  • @yaboariel
    @yaboariel 2 роки тому +1

    How do I do it with async and await? Do you have any video?

    • @bytemyke
      @bytemyke  2 роки тому +1

      I don’t, but I’ll make one and reply with the link when it’s done

    • @bytemyke
      @bytemyke  2 роки тому +1

      @Ariel Yabo Here is the video using async await ua-cam.com/video/0-Xu3tnMEiI/v-deo.html. I do have a github, I don't upload all my code here, but I do upload some of the code for my bigger videos github.com/miketona

    • @bytemyke
      @bytemyke  2 роки тому +1

      Glad I could help! Good luck on your coding endeavors!

  • @batuhanbatuhan6445
    @batuhanbatuhan6445 5 місяців тому

    Myke you need to check your mic

  • @paulp3053
    @paulp3053 2 роки тому +1

    wait! what? this is not async!

    • @bytemyke
      @bytemyke  2 роки тому +1

      This is not. I have an async / await tutorial version here ua-cam.com/video/0-Xu3tnMEiI/v-deo.html

  • @tanushmahajan3359
    @tanushmahajan3359 Рік тому

    Is there a github repo for this code?

    • @bytemyke
      @bytemyke  Рік тому

      I’m sorry, there is not

  • @MatheusSilva-qm3ph
    @MatheusSilva-qm3ph 2 роки тому

    Very cool. Is it possible to have a password to access the database?

    • @bytemyke
      @bytemyke  2 роки тому +2

      That’s a great question! It is not possible to have a password/username in the traditional sense like what you’d see with a mysql database.

  • @ananasios
    @ananasios 2 роки тому

    how to make return data?

    • @bytemyke
      @bytemyke  2 роки тому

      I’m not sure what you’re asking. Could you explain a bit more?

    • @ananasios
      @ananasios 2 роки тому

      How to make the db.all function return rows. Not console.log(row), but return rows

    • @bytemyke
      @bytemyke  2 роки тому

      @@ananasios Gotcha that makes sense. Thanks for the clarification. Rows is an array of objects so you can return it the same way you would any other variable. I would personally wrap the db.all inside of a function and then you'd use a return statement saying "return rows". If it helps there is an example here ua-cam.com/video/mnH_1YGR2PM/v-deo.html at around 9:50 where I return rows as a JSON object using express for an API. Another, and perhaps easier, option is to use async await, I'm planning to make a video showing how to do that with sqlite3 in the near future.

    • @ananasios
      @ananasios 2 роки тому

      @@bytemyke Since asynchronous database queries, the word "return" in the function will work faster than the query to the database and instead of rows will return undifinded.

    • @bytemyke
      @bytemyke  2 роки тому

      @@ananasios Yes you would have to use return similar to the way I do in that video with express. Or you would have to use async await so that it is not undefined

  • @felipemanhaes470
    @felipemanhaes470 2 роки тому

    Man this audio volume is too low!
    The rest is nice.

  • @SeyfettinKKK
    @SeyfettinKKK Місяць тому

    ✌️👍🇹🇷

  • @khizarkhan2250
    @khizarkhan2250 Рік тому

    npm ERR! node-pre-gyp WARN Hit error ENOENT: no such file or directory, open 'D:\path\to\your\cert.pem'
    npm ERR! gyp info it worked if it ends with ok
    npm ERR! gyp info using node-gyp@9.4.0
    npm ERR! gyp info using node@16.20.1 | win32 | x64
    this type of error it is showing when installing npm i sqlite3