Тёмный

Node JS SQLite Crash Course 

Byte Myke
Подписаться 2 тыс.
Просмотров 46 тыс.
50% 1

Come learn how to use SQlite with Node JS in this beginner friendly tutorial! All the power of SQL made light with SQlite, and it is extreamly easy to use with JavaScript via Node.JS. Learn how to connect to a database, create a table, drop a table, insert data, update data, and delete data in JavaScript via node js sqlite.
Written tutorial and GitHub source code: bytemyke.com/blog/how-to-use-...
Chapters
00:00 intro
00:34 Setup
01:30 Create and connect to database
02:35 Creating a table
03:52 Dropping a table
04:22 Inserting data into database
06:45 Querying (SELECT *) from the database
08:15 Updating data
09:43 Deleting data
#sqlite
#database
#nodeJS

Наука

Опубликовано:

 

30 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 99   
@bytemyke
@bytemyke 4 месяца назад
Written tutorial and GitHub source code : bytemyke.com/blog/how-to-use-sqlite-in-node-js/
@almamunroni8593
@almamunroni8593 Год назад
For the first time, i have learned something about Sqlite only for your video content, thanks a lot
@evertdeboer
@evertdeboer 11 месяцев назад
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!
@mehmetsunguralp5509
@mehmetsunguralp5509 Год назад
Very clear and direct to the point! Thanks a lot.
@yajirushik2871
@yajirushik2871 2 года назад
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 года назад
Glad I could help! Good luck with the app
@drpx2880
@drpx2880 Год назад
awesome content, very helpful and straight to the point! keep up the good work
@cassidymcgee5817
@cassidymcgee5817 2 года назад
Great video! Super helpful!
@arv_is
@arv_is 5 месяцев назад
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 5 месяцев назад
Glad it helped!
@MEGAFOXTERRIER
@MEGAFOXTERRIER Год назад
Just what I was looking for, thanks!
@Smileeee_23
@Smileeee_23 Год назад
Thank you I'm from Venezuela and I couldn't find tutorials on this topic in Spanish, really thank you very much
@dormiebasne3578
@dormiebasne3578 Год назад
Fantastic you made an updated version! I love the sqlite3 module in JS for running SQL queries!
@ticTHEhero
@ticTHEhero Год назад
thanks man, very useful, keep up the goodwork
@Filaxsan
@Filaxsan 2 месяца назад
Yo! Thanks Myke! Easy and to the point, keep it up 💪
@bytemyke
@bytemyke 2 месяца назад
Thanks! Will do!
@fabricioitajuba
@fabricioitajuba 28 дней назад
Thanks Myke!!!
@hszt4414
@hszt4414 2 года назад
and again, best SQL JS tutorial out there, few extra thing compared to "blurry" version ! Thanks again!
@joaooliveira9840
@joaooliveira9840 11 месяцев назад
Great video. Thanks a lot!
@shadow_1363
@shadow_1363 3 месяца назад
Incredible tutorial, subbed!
@bytemyke
@bytemyke 3 месяца назад
Thank you!
@dominikilja
@dominikilja Год назад
Good stuff my friend!
@pyyrr
@pyyrr 10 месяцев назад
thanks for the vid, finally shows how to use it.
@tech_kollo
@tech_kollo Год назад
I'm really thankful for this video. This great help lead me to my mental relaxation 😅
@duchieu5863
@duchieu5863 10 месяцев назад
Dude, thanks! Now i can store data no using Json :))
@SeekIntel
@SeekIntel 2 года назад
mike! u the best keep it up man!
@bytemyke
@bytemyke 2 года назад
Thank you! 😁
@SheelByTorn
@SheelByTorn 2 года назад
I need this for our software engineering 1 subject this semester. nice timing😍
@bytemyke
@bytemyke 2 года назад
Glad I could help! I have a BS in CS and RU-vid got me though it haha
@user-zi1td7ij6w
@user-zi1td7ij6w 8 месяцев назад
Super!!! 🎉 Thank you!!!!
@bytemyke
@bytemyke 8 месяцев назад
Welcome 😊
@WaqarRashid
@WaqarRashid Год назад
Great tutorial. Would be nice to have a gist for the final source code
@user-ie7wk7rs6n
@user-ie7wk7rs6n 11 месяцев назад
필요한 강의였어요 추천합니다
@Eihell
@Eihell Год назад
thanks man, can you up the volume in the coming videos? that would be really better ;)
@Khalid-sr4zo
@Khalid-sr4zo Месяц назад
commenting for the algorithm! and of course thank you!!
@bytemyke
@bytemyke Месяц назад
Thank you!
@pasademix
@pasademix 10 месяцев назад
Ты очень крут, спасибо за эти видео😍
@leanrepetitor
@leanrepetitor Год назад
thanks you very much :D
@codelab_channel
@codelab_channel Год назад
Thank you, like🙂
@oscarfelix7244
@oscarfelix7244 Год назад
Thanks dude
@rodhash
@rodhash 27 дней назад
Thanks dude, amazing vid .. liked + sub .. I just was not sure why you use template literals instead of simple quotes or even double quotes
@geoking1907
@geoking1907 2 года назад
Thanks!
@bytemyke
@bytemyke 2 года назад
Of course! Thanks for watching!
@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.
@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?
@ayaanshd
@ayaanshd 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 : ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7AtIjM6_EM8.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 :)
@goodluckoriuwa1669
@goodluckoriuwa1669 2 месяца назад
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
@davidegallo3879
@davidegallo3879 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 года назад
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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mnH_1YGR2PM.html . Here is an online example nodejs.dev/learn/get-http-request-body-data-using-nodejs
@matteomontanari2960
@matteomontanari2960 Год назад
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 Год назад
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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mnH_1YGR2PM.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
@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?
@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?
@rktechworld470
@rktechworld470 10 месяцев назад
you created the database wright test.db if i want to acess the that same database in my system how we can connect
@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?
@Mimi127
@Mimi127 Год назад
Is there a way to make models for the sqlite database for bigger projects?
@ershe
@ershe 7 месяцев назад
How difficult would this be without node/npm? Great tutorial, thank you.
@bytemyke
@bytemyke 7 месяцев назад
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
@InfectedEnnui
@InfectedEnnui Год назад
why sqlite3 instead of sqlite.js?
@goodluckoriuwa1669
@goodluckoriuwa1669 2 месяца назад
What is the efficient gui for SQLite db
@chaymajebri6670
@chaymajebri6670 7 месяцев назад
Please how to use JDBC for sqlite in VSCode ☹
@Buusifer
@Buusifer 2 года назад
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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mnH_1YGR2PM.html . You would just use a form or JavaScript instead of postman
@chou5056
@chou5056 Год назад
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
@goodluckoriuwa1669
@goodluckoriuwa1669 2 месяца назад
I have a question... What type of db is the SQLite??? Is it one if the personal database
@bytemyke
@bytemyke 2 месяца назад
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.
@allsunday1485
@allsunday1485 Год назад
why is the data you log into the terminal formatted? @8:00 ?
@reddit3180
@reddit3180 Год назад
He must have installed auto formatter vs code extension
@yaboariel
@yaboariel 2 года назад
How do I do it with async and await? Do you have any video?
@bytemyke
@bytemyke 2 года назад
I don’t, but I’ll make one and reply with the link when it’s done
@bytemyke
@bytemyke 2 года назад
@Ariel Yabo Here is the video using async await ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-0-Xu3tnMEiI.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 года назад
Glad I could help! Good luck on your coding endeavors!
@lamborghinicentenario2497
@lamborghinicentenario2497 2 месяца назад
How do I fix "no such table: xxxxx"? The table exists I'm sure
@bytemyke
@bytemyke 2 месяца назад
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.
@tosinolugbenga2904
@tosinolugbenga2904 Год назад
I got this error SQLITE_CANTOPEN, unable to open database file
@HoussamElhertani
@HoussamElhertani Год назад
me to?????
@MatheusSilva-qm3ph
@MatheusSilva-qm3ph 2 года назад
Very cool. Is it possible to have a password to access the database?
@bytemyke
@bytemyke 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.
@goodluckoriuwa1669
@goodluckoriuwa1669 2 месяца назад
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 2 месяца назад
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 2 месяца назад
@@bytemyke Okay will be waiting for that... let see how that can really help.... How long have you been using sqlite?
@goodluckoriuwa1669
@goodluckoriuwa1669 2 месяца назад
can we get closer on social media?? perhaps whatsapp or instagram?
@bytemyke
@bytemyke 2 месяца назад
@@goodluckoriuwa1669 Sure! I have my linkedin in my youtube profile if you would like to connect with me there.
@tanushmahajan3359
@tanushmahajan3359 Год назад
Is there a github repo for this code?
@bytemyke
@bytemyke Год назад
I’m sorry, there is not
@batuhanbatuhan6445
@batuhanbatuhan6445 Месяц назад
Myke you need to check your mic
@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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mnH_1YGR2PM.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
@paulp3053
@paulp3053 2 года назад
wait! what? this is not async!
@bytemyke
@bytemyke 2 года назад
This is not. I have an async / await tutorial version here ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-0-Xu3tnMEiI.html
@felipemanhaes470
@felipemanhaes470 Год назад
Man this audio volume is too low! The rest is nice.
@khizarkhan2250
@khizarkhan2250 11 месяцев назад
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
Далее
Learn Express JS In 35 Minutes
36:03
Просмотров 760 тыс.
MongoDB Crash Course
29:59
Просмотров 655 тыс.
SQLite3 in Node with better-sqlite3
12:08
Просмотров 4,5 тыс.
Production SQLite with Turso and libSQL
1:02:53
Просмотров 6 тыс.
SQLite in Production - Master Course
6:37
Просмотров 3,3 тыс.
Protocol Buffers Crash Course
36:07
Просмотров 236 тыс.
Sql.js - full SQLite in the browser
9:11
Просмотров 15 тыс.