Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
Prism.svelte
generator.js
<script>
import Prism from './Prism.svelte'
import generate from './generator'
let name = 'posts'
let fields = [
{ name: 'title', type: 'string', nullable: false, localizable: true },
{ name: 'permalink', type: 'string', nullable: false },
{ name: 'body', type: 'text', nullable: false, localizable: true },
{ name: 'tags', type: 'string', array: true}
]
function remove(field) {
if (!confirm("Are you sure?")) return
fields = fields.filter(f => f !== field)
}
function add() {
fields = [...fields, {name: '', type: 'string'}]
}
$: sql = generate({name, fields})
</script>

<h1>Supabase CMS generator w/ localizations</h1>

<label class="title">
Table<br/>
<input bind:value={name}/>
</label>

<h2>Fields</h2>

<table>
<thead>
<tr>
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */