This is a professional grade lesson. It was great to see how you organized your files, how you made long lines of code multi-line and readable, and made each part modular. I hope more folks see this.
Nice tutorial. I like that you kept the code and files to a minimum while still showing core concepts. I am newish to OOP and SQLAlchemy 2.0 so it helps with the learning curve.
I believe you are mistaken, sqlalchemy core is when you define tables manually and drop down to actual sql. Clearly I am using the ORM here as I am using models!
What we don't need is another intro to Sqlalchemy What we do need is a tutorial on how to write advanced Sqlalchemy queries using window functions (rank, dense, row number), etc.
Hi Chris, it’s always good to have a base foundation to start with as it helps understand the basics. I am happy to make a more advanced tutorial in the near future!
Glad you enjoyed it! It's the same, the only difference is that you don't have to wire SQLAlchemy yourself. If you check one of my videos on the API series for SQLAlchemy that uses flask-sqlalchemy.
@@PetsasSoftware sure, will definitely checkout the video. I have actually started watching that series. Thanks for such a great content brother. Hope you make videos on advanced SQL alchemy concepts as well.
Glad you enjoyed it! I have a series on building a Restful API, that should be a good start: ua-cam.com/play/PLSLBozfq-zZfEC7jDJcj0gjW5zR8jN75p.html&si=G-Qy8GrSkj5PGxLe
Great presentation! Thank you. Should an inexperienced programmer (I'm a noob) be concerned with this from documentation: class DeclarativeBase() vs. declarative_base(). This is a level of complexity beyond my current skill. Thanks again. :)
It seems DeclarativeBase supersedes this function in newer versions of SQLAlchemy. If I was you I would use everything you learned from this video with the exception of using the flask-sqlalchemy package if you are using flask because it sets the starting point for you. I have a video on my channel for that as well.
Hi there, you can add the constraint on your model normally and then create a migration and run it, for example: user_id = db.Column(db.Integer, db.ForeignKey("users.id", ondelete="CASCADE"), primary_key=True) then run: flask db migrate, check that the migration looks correct and then run flask db upgrade. If you encounter issues then the issue might be that foreign key names are not being generated but are needed by the database itself in which case you might need to modify the generated migration file and include a unique foreign key name. If an existing foreign key exists you will need to drop that first and then create the new foreign key right after. Try this and let me know how it goes, if you come into issues I will try and offer more assistance!
This is a professional grade lesson. It was great to see how you organized your files, how you made long lines of code multi-line and readable, and made each part modular. I hope more folks see this.
Thank you very much John for your kind words, I appreciate it!
Nice tutorial. I like that you kept the code and files to a minimum while still showing core concepts. I am newish to OOP and SQLAlchemy 2.0 so it helps with the learning curve.
I am very happy it helps! Happy learning!
you've increased my developing level, thx man.
Glad I could be of help! Keep coding!
Thanks for the tutorial! Maybe one of the best on UA-cam!
You’re welcome! Thank you for you kind words and I am glad you found it useful!
The best tutorial of sqlAlchemy. Perfect combination of nicely organized content, clear voice and detail explanation. Thanks!
Thank you for your great words, I appreciate it!
Best ever tutorial on UA-cam ever
Thank you for your kind words!
this is very easy to understand, you made it easy to be precise, please keep up the good work.
Glad you found it easy to understand, thank you for your kind words!
Thanks, that was a great introduction.
Glad you enjoyed it, check out the second part too for more advanced concepts!
nice tutorial. Easy to get started with sqlalchemy
Glad you liked it! Part 2 was just released today, feel free to check it out!
Nice tutorial! That really helped me to understand db queries 👍
I am glad you enjoyed it and understood db queries!
it's about alchemy core)) surprise surprise but title is SQLAlchemy ORM 😀 best youtuber ever
I believe you are mistaken, sqlalchemy core is when you define tables manually and drop down to actual sql. Clearly I am using the ORM here as I am using models!
Maybe he is referring to not using mapped_columns? Which confuse me@@PetsasSoftware
What we don't need is another intro to Sqlalchemy
What we do need is a tutorial on how to write advanced Sqlalchemy queries using window functions (rank, dense, row number), etc.
Hi Chris, it’s always good to have a base foundation to start with as it helps understand the basics. I am happy to make a more advanced tutorial in the near future!
@@PetsasSoftware looking forward to it!
ua-cam.com/video/UPoHdCeg0YQ/v-deo.htmlsi=R0kPdRcieO6u30Ct
@@PetsasSoftware That would be awesome!
Thank you, helped me a lot.
ps: I think Pathlib is easier to use for paths
I believe you might be right thanks!
Top quality content❤❤!! Can you also make a detailed video on flask-sqlalchemy... or is it same
Glad you enjoyed it! It's the same, the only difference is that you don't have to wire SQLAlchemy yourself. If you check one of my videos on the API series for SQLAlchemy that uses flask-sqlalchemy.
@@PetsasSoftware sure, will definitely checkout the video. I have actually started watching that series. Thanks for such a great content brother. Hope you make videos on advanced SQL alchemy concepts as well.
Thank you for your good words! I was a bit busy with work but will definitely publish some more videos in the coming weeks!
It's really good
Please guide me to next step what should I learn after this course
Glad you enjoyed it!
I have a series on building a Restful API, that should be a good start:
ua-cam.com/play/PLSLBozfq-zZfEC7jDJcj0gjW5zR8jN75p.html&si=G-Qy8GrSkj5PGxLe
Great presentation! Thank you. Should an inexperienced programmer (I'm a noob) be concerned with this from documentation: class DeclarativeBase() vs. declarative_base(). This is a level of complexity beyond my current skill. Thanks again. :)
It seems DeclarativeBase supersedes this function in newer versions of SQLAlchemy. If I was you I would use everything you learned from this video with the exception of using the flask-sqlalchemy package if you are using flask because it sets the starting point for you. I have a video on my channel for that as well.
Hi @Demos.. How can we add ondelete constraint after we have already created the table, without having to delete the tables and the records.
Hi there, you can add the constraint on your model normally and then create a migration and run it, for example:
user_id = db.Column(db.Integer, db.ForeignKey("users.id", ondelete="CASCADE"), primary_key=True)
then run:
flask db migrate, check that the migration looks correct and then run flask db upgrade.
If you encounter issues then the issue might be that foreign key names are not being generated but are needed by the database itself in which case you might need to modify the generated migration file and include a unique foreign key name.
If an existing foreign key exists you will need to drop that first and then create the new foreign key right after.
Try this and let me know how it goes, if you come into issues I will try and offer more assistance!
If I could I would give 100 likes on this video
I am happy you find it useful!
Sqlalchemy orm is too slow, it's better to use sqlalchemy core
too tiny