diff --git a/apps/docs/pages/guides/getting-started/quickstarts/laravel.mdx b/apps/docs/pages/guides/getting-started/quickstarts/laravel.mdx index 84ad9a05cab..9d51cde217a 100644 --- a/apps/docs/pages/guides/getting-started/quickstarts/laravel.mdx +++ b/apps/docs/pages/guides/getting-started/quickstarts/laravel.mdx @@ -54,6 +54,8 @@ export const meta = { When your project is up and running, navigate to the [database settings](https://supabase.com/dashboard/project/_/settings/database) to find the URI connection string. + In this quickstart, we are going to connect via the connection pooler. Make sure to select `Session mode`! If your network supports IPv6, you can connect to the database directly without using the connection pooler. + Laravel ships with a Postgres adapter out of the box, you can simply configure it via the environment variables. You can find the database URL in your [Supabase Dashboard](/dashboard/project/_/settings/database). @@ -62,7 +64,7 @@ export const meta = { ```bash .env DB_CONNECTION=pgsql - DATABASE_URL=postgres://postgres.xxxx:password@xxxx.pooler.supabase.com:6543/postgres + DATABASE_URL=postgres://postgres.xxxx:password@xxxx.pooler.supabase.com:5432/postgres ``` diff --git a/apps/docs/pages/guides/getting-started/quickstarts/ruby-on-rails.mdx b/apps/docs/pages/guides/getting-started/quickstarts/ruby-on-rails.mdx index 0ae0e7fb31e..55d27d01913 100644 --- a/apps/docs/pages/guides/getting-started/quickstarts/ruby-on-rails.mdx +++ b/apps/docs/pages/guides/getting-started/quickstarts/ruby-on-rails.mdx @@ -36,6 +36,8 @@ export const meta = { When your project is up and running, navigate to the [database settings](https://supabase.com/dashboard/project/_/settings/database) to find the URI connection string. + In this quickstart, we are going to connect via the connection pooler. Make sure to select `Session mode`! If your network supports IPv6, you can connect to the database directly without using the connection pooler. + Rails ships with a Postgres adapter included, you can simply configure it via the environment variables. You can find the database URL in your [Supabase Dashboard](/dashboard/project/_/settings/database). @@ -43,7 +45,7 @@ export const meta = { ```bash Terminal - export DATABASE_URL=postgres://postgres.xxxx:password@xxxx.pooler.supabase.com:6543/postgres + export DATABASE_URL=postgres://postgres.xxxx:password@xxxx.pooler.supabase.com:5432/postgres ``` diff --git a/apps/www/_blog/2024-01-22-laravel-postgres.mdx b/apps/www/_blog/2024-01-22-laravel-postgres.mdx index 1a1a78fe677..a677113a1fa 100644 --- a/apps/www/_blog/2024-01-22-laravel-postgres.mdx +++ b/apps/www/_blog/2024-01-22-laravel-postgres.mdx @@ -71,7 +71,7 @@ Laravel ships with a Postgres adapter out of the box, you can simply configure i ```bash .env DB_CONNECTION=pgsql -DATABASE_URL=postgres://postgres.xxxx:password@xxxx.pooler.supabase.com:6543/postgres +DATABASE_URL=postgres://postgres.xxxx:password@xxxx.pooler.supabase.com:5432/postgres ``` ### Change the default schema diff --git a/apps/www/_blog/2024-01-29-ruby-on-rails-postgres.mdx b/apps/www/_blog/2024-01-29-ruby-on-rails-postgres.mdx new file mode 100644 index 00000000000..25214352417 --- /dev/null +++ b/apps/www/_blog/2024-01-29-ruby-on-rails-postgres.mdx @@ -0,0 +1,155 @@ +--- +title: Getting started with Ruby on Rails and Postgres on Supabase +description: 'Learn how to create a new Rails app and connect it to a Supabase Postgres database.' +author: thor_schaeff +image: getting-started/rails/rails.jpg +thumb: getting-started/rails/rails.jpg +categories: + - engineering +tags: + - postgres + - developers + - ruby +date: '2024-01-29' +toc_depth: 3 +--- + +Every Supabase project comes with a full [Postgres](https://www.postgresql.org/) database, a free and open source database which is considered one of the world's most stable and advanced databases. + +Postgres is an ideal choice for your Ruby on Rails applications as Rails ships with a built-in Postgres adapter! + +In this post we'll start from scratch, creating a new Rails project, connecting it to our Supabase Postgres database, and interacting with the database using the Rails Console. + + + +Supabase is one of the best [free alternatives to Heroku Postgres](/alternatives/supabase-vs-heroku-postgres). See [this guide](/docs/guides/resources/migrating-to-supabase/heroku) to learn how to migrate from Heroku to Supabase. + +There's also a [Heroku to Supabase migration tool](https://migrate.supabase.com/) available to migrate in just a few clicks. + + + +If you prefer video guide, you can follow along below. And make sure to subscribe to the [Supabase YouTube channel](https://www.youtube.com/channel/UCNTVzV1InxHV-YR0fSajqPQ?view_as=subscriber&sub_confirmation=1)! + +
+