AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Full join in postgresql8/28/2023 ![]() In order to let us play with Ecto in the IEx console we'll set up a sample project and add Ecto as a dependency. If you don't want to run code examples on your machine have a brief look at our sample data below and feel free to jump ahead to joins. This and the following section include steps required to set up a project using Ecto and populate the database with some sample data. On top of queries, Ecto provides numerous other features, such as Schemas, which we are deliberately not going to use here to keep things as simple as possible. ![]() It provides a feature-rich and readable query DSL which covers the vast majority of queries one might typically need. It allows us to access relational databases from Elixir applications without having to write plain SQL. What is Ecto?Įcto is a database wrapper library for the Elixir programming language. If we wanted to display a list of orders with corresponding customer names we'd need to join the two tables together. A somewhat classic example might be a customers table containing customer data and an orders table containing order details. Joins allow us to combine rows from two or more tables in order to answer questions that require data from multiple sources. In relational databases data is stored in tables. This is why in this article I am going to do both and we'll review the basics of SQL joins but we'll query the database using Ecto, a database wrapper for Elixir.īecause we are going to need some test data to play with, we'll also set up a sample Elixir project, add Ecto to it and configure it to connect to a local instance of Postgres. Whilst I think that learning new things is an important part of being a developer, I find it is also quite useful to go back to basics once in a while. SQL joins with Ecto A review of SQL joins and how to do them in Ecto Going back to basicsĪs back-end developers, SQL and relational databases are often a significant part of our daily workflows.
0 Comments
Read More
Leave a Reply. |