Skip to content

Commit

Permalink
docs: rename .mdx files to .md. (#338)
Browse files Browse the repository at this point in the history
I've verified this works with the website repo and GitHub previewing.
  • Loading branch information
thruflo authored Aug 21, 2023
1 parent 11c4d40 commit a5fcec7
Show file tree
Hide file tree
Showing 86 changed files with 187 additions and 187 deletions.
File renamed without changes.
10 changes: 5 additions & 5 deletions docs/api/ddlx.mdx → docs/api/ddlx.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ sidebar_position: 10
:::caution Limitations
The syntax and features described in this page are **not yet implemented**.

Currently, DDLX rules are limited to [electrification by SQL proceedure call syntax](../reference/limitations#ddlx-rules). See the [Limitations](../reference/limitations.mdx) page for more context.
Currently, DDLX rules are limited to [electrification by SQL proceedure call syntax](../reference/limitations#ddlx-rules). See the [Limitations](../reference/limitations.md) page for more context.
:::

ElectricSQL extends the PostgreSQL language with the following DDLX statements.

Use these in your [migrations](../usage/data-modelling/migrations.mdx) to [electrify tables](../usage/data-modelling/electrification.mdx) and expose data by granting [permissions](../usage/data-modelling/permissions.mdx) to roles and assigning roles to [authenticated](../usage/auth/index.mdx) users.
Use these in your [migrations](../usage/data-modelling/migrations.md) to [electrify tables](../usage/data-modelling/electrification.md) and expose data by granting [permissions](../usage/data-modelling/permissions.md) to roles and assigning roles to [authenticated](../usage/auth/index.md) users.

## Electrification

Tables must be [electrified](../usage/data-modelling/electrification.mdx) to include them in the replication machinery.
Tables must be [electrified](../usage/data-modelling/electrification.md) to include them in the replication machinery.

### `ENABLE`

Expand Down Expand Up @@ -318,7 +318,7 @@ ELECTRIC REVOKE UPDATE (

### `ASSIGN`

Assigns a role to an [authenticated user](../usage/auth/index.mdx).
Assigns a role to an [authenticated user](../usage/auth/index.md).

```sql
ELECTRIC ASSIGN role_definition
Expand All @@ -327,7 +327,7 @@ ELECTRIC ASSIGN role_definition
[ IF if_statement ];
```

Roles are **not** assigned to normal PostgreSQL database users. Instead, they are assigned to your application's [authenticated end users](../usage/auth/index.mdx) by matching their `auth.user_id` with foreign keys in your data model.
Roles are **not** assigned to normal PostgreSQL database users. Instead, they are assigned to your application's [authenticated end users](../usage/auth/index.md) by matching their `auth.user_id` with foreign keys in your data model.

Each assignment rule watches a table `table_name` that has a foreign key referencing your users table and assigns its `role_definition` to the user dynamically based on the database contents.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ Install dependencies:
yarn
```

Run the backend services ([Postgres](../../usage/installation/postgres.mdx) + [Electric](../../usage/installation/service.mdx)):
Run the backend services ([Postgres](../../usage/installation/postgres.md) + [Electric](../../usage/installation/service.md)):

```shell
yarn backend:start
```

Apply database [migrations](../../usage/data-modelling/migrations.mdx):
Apply database [migrations](../../usage/data-modelling/migrations.md):

```shell
yarn db:migrate
```

Use the database schema to generate your [type-safe Client](../../usage/data-access/client.mdx):
Use the database schema to generate your [type-safe Client](../../usage/data-access/client.md):

```shell
yarn client:generate
Expand All @@ -43,7 +43,7 @@ yarn start

- your Postgres is up and running and configured with `wal_level = 'logical'`
- you don't already have a publication called `postgres_1`
- you have a database user with [adequate permissions](../../usage/installation/postgres.mdx#permissions) -- the simplest being `SUPERUSER`
- you have a database user with [adequate permissions](../../usage/installation/postgres.md#permissions) -- the simplest being `SUPERUSER`

### Running the sync service

Expand Down
2 changes: 1 addition & 1 deletion docs/index.mdx → docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Or for the fastest way to start coding, jump in with the <DocPageLink path="quic

## Example apps

See the [example applications](./top-level-listings/examples.mdx) for reference code and to see what you can build with Electric:
See the [example applications](./top-level-listings/examples.md) for reference code and to see what you can build with Electric:

<div className="grid grid-cols-1 sm:grid-cols-2 gap-6">
<div className="tile">
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import DocCardList from '@theme/DocCardList'
See <DocPageLink path="usage/data-modelling" /> for current limitations on data modelling and migrations.
:::

ElectricSQL is designed to work with [any Postgres-backed system](../../usage/installation/postgres.mdx). You don't need a specific ([or, in fact, any](./other.mdx)) backend framework to use Electric.
ElectricSQL is designed to work with [any Postgres-backed system](../../usage/installation/postgres.md). You don't need a specific ([or, in fact, any](./other.md)) backend framework to use Electric.

However, it's common to manage the Postgres data model using a migrations system. These are often provided by your web framework. Because ElectricSQL's [DDLX Rules](../../api/ddlx.mdx) are applied using DDL migrations, this section shows you how to do this using some popular frameworks.
However, it's common to manage the Postgres data model using a migrations system. These are often provided by your web framework. Because ElectricSQL's [DDLX Rules](../../api/ddlx.md) are applied using DDL migrations, this section shows you how to do this using some popular frameworks.

:::note
Some frameworks also provide or work with Postgres change data capture tooling, such as logical replication consumers. This can be useful for [Event sourcing](../event-sourcing/index.mdx).
Some frameworks also provide or work with Postgres change data capture tooling, such as logical replication consumers. This can be useful for [Event sourcing](../event-sourcing/index.md).
:::

<DocCardList />
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ description: >-
sidebar_position: 80
---

ElectricSQL is designed to work with [any Postgres-backed system](../../usage/installation/postgres.mdx). You don't need a backend framework to use Electric.
ElectricSQL is designed to work with [any Postgres-backed system](../../usage/installation/postgres.md). You don't need a backend framework to use Electric.

## Migrations

You can use any migrations framework that supports executing arbitrary SQL. This includes executing [raw SQL statements](./sql.mdx).
You can use any migrations framework that supports executing arbitrary SQL. This includes executing [raw SQL statements](./sql.md).

See the other framework examples in this section for pointers.

:::note
If you don't have a data model already and you're looking for a tool to define and manage your Postgres database schema, we recommend [using Prisma](./prisma.mdx).
If you don't have a data model already and you're looking for a tool to define and manage your Postgres database schema, we recommend [using Prisma](./prisma.md).
:::

## Event sourcing

There are lots of ways of consuming and responding to data change events with Postgres. See <DocPageLink path="integrations/event-sourcing" /> for more information.

:::note
If you're looking for a web framework that works well with realtime data processing and event sourcing, we recommend [Phoenix](./phoenix.mdx).
If you're looking for a web framework that works well with realtime data processing and event sourcing, we recommend [Phoenix](./phoenix.md).
:::
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ npx prisma migrate dev

## Generator

Electric uses a customised version of the [zod-prisma-types](https://github.com/chrishoermann/zod-prisma-types) Prisma client generator to [generate](../../api/generator.mdx) the [Electric Client](../../usage/data-access/client.mdx).
Electric uses a customised version of the [zod-prisma-types](https://github.com/chrishoermann/zod-prisma-types) Prisma client generator to [generate](../../api/generator.md) the [Electric Client](../../usage/data-access/client.md).

## Event sourcing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 50

## Migrations

With [Rails](../../integrations/backend/rails.mdx) you can `execute` SQL in the [`change` method](https://guides.rubyonrails.org/active_record_migrations.html#using-the-change-method) of your migration class.
With [Rails](../../integrations/backend/rails.md) you can `execute` SQL in the [`change` method](https://guides.rubyonrails.org/active_record_migrations.html#using-the-change-method) of your migration class.

First, create a migration:

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import DocCardList from '@theme/DocCardList';

ElectricSQL is designed for self-host, i.e.: to be deployed on your infrastructure and hosting platform of choice.

The main component to deploy is the [Electric sync service](../../api/service.mdx). This sits between your local-first apps and [your Postgres database](../../usage/installation/postgres.mdx). It's a horizontally scalable Elixir web service without any special durability requirements, typically packaged [using Docker](./docker.mdx).
The main component to deploy is the [Electric sync service](../../api/service.md). This sits between your local-first apps and [your Postgres database](../../usage/installation/postgres.md). It's a horizontally scalable Elixir web service without any special durability requirements, typically packaged [using Docker](./docker.md).

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
sidebar_position: 50
---

To run the [Electric sync service](../../api/service.mdx) in [Kubernetes](https://kubernetes.io) deploy the [Docker image](./docker.mdx) within a [Pod](https://kubernetes.io/docs/concepts/workloads/controllers/pod), usually via a [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment).
To run the [Electric sync service](../../api/service.md) in [Kubernetes](https://kubernetes.io) deploy the [Docker image](./docker.md) within a [Pod](https://kubernetes.io/docs/concepts/workloads/controllers/pod), usually via a [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment).

The container image needs ports `5050`, `5133` and `5433` exposed and the environment variables described in <DocPageLink path="api/service" /> configured.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ description: >-
sidebar_position: 60
---

The [Electric sync service](../../api/service.mdx) is usually packaged and run [using Docker](./docker.mdx). However, under the hood, it's a standard [Elixir](https://elixir-lang.org/) application. This runs on the BEAM and can be deployed in many ways. This includes support for hot code reloading and integration into existing applications.
The [Electric sync service](../../api/service.md) is usually packaged and run [using Docker](./docker.md). However, under the hood, it's a standard [Elixir](https://elixir-lang.org/) application. This runs on the BEAM and can be deployed in many ways. This includes support for hot code reloading and integration into existing applications.

See the source code and [Makefile](https://github.com/electric-sql/electric/blob/main/components/electric/Makefile) at [electric-sql/electric/components/electric](https://github.com/electric-sql/electric/tree/main/components/electric) for more information. [Let us know on Discord](https://discord.electric-sql.com) if we can help.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Unfortunately, currently, deployment to [Render.com](https://render.com) is not
1. [Allow for Postgres logical replication](https://feedback.render.com/features/p/allow-for-postgres-logical-replication)
2. [Allow connecting to non-HTTP services from outside Render](https://feedback.render.com/features/p/allow-connecting-to-non-http-services-from-outside-render)

The [Electric sync service](../../api/service.mdx) is a web service that exposes multiple ports. On Render, public [Web Services](https://render.com/docs/web-services) are only available over HTTP(s) on standard ports. [Private Services](https://render.com/docs/private-services) are available internally over TCP and on multiple ports. However, the Electric sync service requires an inbound TCP ("logical publisher") connection from the Postgres database.
The [Electric sync service](../../api/service.md) is a web service that exposes multiple ports. On Render, public [Web Services](https://render.com/docs/web-services) are only available over HTTP(s) on standard ports. [Private Services](https://render.com/docs/private-services) are available internally over TCP and on multiple ports. However, the Electric sync service requires an inbound TCP ("logical publisher") connection from the Postgres database.

## Allow for Postgres logical replication

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Adapt the SQLite database driver for your target environment.

## How drivers work

ElectricSQL works with existing SQLite database drivers. Connect to your local SQLite database using your existing driver library. Then pass the database `conn` to your driver adapter's `electrify` function when [instantiating your Client](../../usage/data-access/client.mdx#instantiating-the-client).
ElectricSQL works with existing SQLite database drivers. Connect to your local SQLite database using your existing driver library. Then pass the database `conn` to your driver adapter's `electrify` function when [instantiating your Client](../../usage/data-access/client.md#instantiating-the-client).

## Supported drivers

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ALTER TABLE oban_jobs
ENABLE ELECTRIC;
```

Then use the [Electric Client](../../usage/data-access/client.mdx) directly in your local-first app to insert into the jobs table, e.g.:
Then use the [Electric Client](../../usage/data-access/client.md) directly in your local-first app to insert into the jobs table, e.g.:

```tsx
await db.oban_jobs.create({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import DocCardList from '@theme/DocCardList'

ElectricSQL is designed to integrate with existing reactivity and component frameworks.

This allows you to bind [live queries](../../usage/data-access/queries.mdx) to component state and hook into data and connectivity change events.
This allows you to bind [live queries](../../usage/data-access/queries.md) to component state and hook into data and connectivity change events.

:::caution Limitations
ElectricSQL currently only has official support for React (both ReactJS and React Native).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 10

ElectricSQL integrates with React via a [Context provider](#electricprovider) and [Hooks](#hooks).

The context provider provides your Electric [Client](../../usage/data-access/client.mdx) to your components. The hooks are used to bind [live queries](../../usage/data-access/queries.mdx#live-queries) to your components and handle connectivity state. You can see both in action in the <DocPageLink path="examples/basic" />.
The context provider provides your Electric [Client](../../usage/data-access/client.md) to your components. The hooks are used to bind [live queries](../../usage/data-access/queries.md#live-queries) to your components and handle connectivity state. You can see both in action in the <DocPageLink path="examples/basic" />.

## Context

Expand All @@ -30,7 +30,7 @@ We provide this dynamic API rather than static `ElectricProvider` and `useElectr

### `ElectricProvider`

`ElectricProvider` is a [Context.Provider](https://reactjs.org/docs/context.html#contextprovider) that accepts an Electric [Client](../../usage/data-access/client.mdx) as it's value. Use it to pass down your electrified Client instance to your components, e.g.:
`ElectricProvider` is a [Context.Provider](https://reactjs.org/docs/context.html#contextprovider) that accepts an Electric [Client](../../usage/data-access/client.md) as it's value. Use it to pass down your electrified Client instance to your components, e.g.:

```tsx
// wrapper.tsx
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/intro/active-active.mdx → docs/intro/active-active.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
WatchSlidersCommand,
} from '@site/intro/src/components/commands'

In the previous steps on [realtime multi-user](./multi-user.mdx) and [conflict-free offline](./offline.mdx), we've seen data sync between users and their devices. What we *haven't* yet seen is how it syncs via and with a Postgres database in the cloud.
In the previous steps on [realtime multi-user](./multi-user.md) and [conflict-free offline](./offline.md), we've seen data sync between users and their devices. What we *haven't* yet seen is how it syncs via and with a Postgres database in the cloud.

## SQLite &lt;&gt; Postgres

Expand Down Expand Up @@ -50,8 +50,8 @@ More to the point, it turns your existing management interfaces (anything that w

## Schema evolution

You can also use Postgres to update your local database schema. Write your DDL migrations [using your preferred web framework](../usage/data-modelling/migrations.mdx). Apply them to Postgres. ElectricSQL picks up on the changes and propagates them through the replication stream.
You can also use Postgres to update your local database schema. Write your DDL migrations [using your preferred web framework](../usage/data-modelling/migrations.md). Apply them to Postgres. ElectricSQL picks up on the changes and propagates them through the replication stream.

<hr className="doc-divider" />

So we've seen active-active replication and schema propagation. Now let's see how you control these replication flows using [dynamic sync controls &raquo;](./sync-controls.mdx)
So we've seen active-active replication and schema propagation. Now let's see how you control these replication flows using [dynamic sync controls &raquo;](./sync-controls.md)
4 changes: 2 additions & 2 deletions docs/intro/local-first.mdx → docs/intro/local-first.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Along the way, we hope you'll be convinced to stop building cloud-first systems
This is an interactive demo. You can play with the widgets in the browser and you can play with the source code for the widgets in the live editor as you go. You can also find all the source code in the [examples/introduction](https://github.com/electric-sql/electric/tree/main/examples/introduction) folder of the main [electric&#8209;sql/electric](https://github.com/electric-sql/electric) repo.

:::note
If you just want the fastest way to start coding, jump to the [Quickstart](../quickstart/index.mdx) instead.
If you just want the fastest way to start coding, jump to the [Quickstart](../quickstart/index.md) instead.
:::

## Let's get started
Expand All @@ -42,4 +42,4 @@ Ultimately, if you have the network on your interaction path, the quality of you

<hr className="doc-divider" />

Instant reactivity is one aspect of local-first. Another is [realtime multi-user](./multi-user.mdx) collaboration. Let's explore that next &raquo;
Instant reactivity is one aspect of local-first. Another is [realtime multi-user](./multi-user.md) collaboration. Let's explore that next &raquo;
4 changes: 2 additions & 2 deletions docs/intro/multi-user.mdx → docs/intro/multi-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl'
import RealtimeDemo from '!!raw-loader!@site/intro/src/demos/multi-user/realtime.jsx'
import { getOrCreateSessionId } from '@site/intro/src/session'

As well as being [instantly reactive](./local-first.mdx), local-first also naturally supports multi-user collaboration. You write data locally and it syncs in the background between users and devices.
As well as being [instantly reactive](./local-first.md), local-first also naturally supports multi-user collaboration. You write data locally and it syncs in the background between users and devices.

:::note
Remember, source code for the widgets in this introduction is in the [examples/introduction](https://github.com/electric-sql/electric/tree/main/examples/introduction) folder of the main [electric&#8209;sql/electric](https://github.com/electric-sql/electric) repo.
Expand Down Expand Up @@ -85,4 +85,4 @@ Scan the QR code and scroll down a touch to see the same multi-user demo app. Al

<hr className="doc-divider" />

As we'll see in [active-active replication](./active-active.mdx), sync isn't limited to web and mobile. Before we dive into that, let's first see how realtime sync and [conflict-free offline](./offline.mdx) play together &raquo;
As we'll see in [active-active replication](./active-active.md), sync isn't limited to web and mobile. Before we dive into that, let's first see how realtime sync and [conflict-free offline](./offline.md) play together &raquo;
Loading

0 comments on commit a5fcec7

Please sign in to comment.