Xata SQL over HTTP + ORM
<p><strong>These are definition of insanity.</strong> Xata are getting out of control, they does not stop release new features after released. Through hype-driven-development, <strong><em>“SQL over HTTP”</em> is like a bullish trend</strong>.</p>
<p><strong>We’re working on multiple xata plug-in to give our best to community.</strong> Our biggest challenge are support O(n) ORM library, and somehow we should mixing those library with Xata functionality through our wrapper.</p>
<p>In order to enabling Xata abilities, we design a custom plug-in for ORM (wrapper) and finally user can seamlessly uses ORM as Xata SDK, it’s like reflection, a mirror, I mean basically we rewrite the code as plug-in.</p>
<p>Those request are sent through “SQL PROXY” that enabling parser instance to run <a href="https://github.com/pganalyze/pg_query_go" rel="noopener ugc nofollow" target="_blank">pg-query-go</a> library from <a href="https://pganalyze.com/" rel="noopener ugc nofollow" target="_blank">PGAnalyze</a>. These action require a maximum safety inspection. <strong>We’re keep on the track!</strong></p>
<h1>Examples and SDK Suppport</h1>
<pre>
const { records: myRecord } = await xata.sql<TeamsRecord>`SELECT * FROM "teams"`;
const { records: myRecord } = await xata.sql<TeamsRecord>`SELECT * FROM "teams" WHERE name=${name}`;
const { records: myRecord } = await xata.sql<TeamsRecord>`SELECT "primaryTitle", md5("primaryTitle"), avg("runtimeMinutes") FROM titles GROUP BY "primaryTitle"`;</pre>
<pre>
records = xata.sql().query('''SELECT * FROM "teams"''')
records = xata.sql().query('''SELECT * FROM "teams" WHERE name=$1''', params=[name])
records = xata.sql().query('''SELECT "primaryTitle", md5("primaryTitle"), avg("runtimeMinutes") FROM titles GROUP BY "primaryTitle"''')</pre>
<pre>
// POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/sql
{
"statement": "SELECT * FROM \"teams\""
}
// POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/sql
{
"statement": "SELECT * FROM \"teams\" WHERE name=$",
"params": ["name"]
}
// POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/sql
{
"statement": "SELECT \"primaryTitle\", md5(\"primaryTitle\"), avg(\"runtimeMinutes\") FROM titles GROUP BY \"primaryTitle\""
}</pre>
<h1>Which better Kysely or Drizzle?</h1>
<p><em>Comparing Kysely, and Drizzle Github Repositories.</em></p>
<p><a href="https://medium.com/@yusril.ihsanul.alim/xata-sql-over-http-orm-d7ec0687d33e">Visit Now</a></p>