Xata SQL over HTTP + ORM

<p><strong>These are definition of insanity.</strong>&nbsp;Xata are getting out of control, they does not stop release new features after released. Through hype-driven-development,&nbsp;<strong><em>&ldquo;SQL over HTTP&rdquo;</em>&nbsp;is like a bullish trend</strong>.</p> <p><strong>We&rsquo;re working on multiple xata plug-in to give our best to community.</strong>&nbsp;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&rsquo;s like reflection, a mirror, I mean basically we rewrite the code as plug-in.</p> <p>Those request are sent through &ldquo;SQL PROXY&rdquo; that enabling parser instance to run&nbsp;<a href="https://github.com/pganalyze/pg_query_go" rel="noopener ugc nofollow" target="_blank">pg-query-go</a>&nbsp;library from&nbsp;<a href="https://pganalyze.com/" rel="noopener ugc nofollow" target="_blank">PGAnalyze</a>. These action require a maximum safety inspection.&nbsp;<strong>We&rsquo;re keep on the track!</strong></p> <h1>Examples and SDK Suppport</h1> <pre> const { records: myRecord } = await xata.sql&lt;TeamsRecord&gt;`SELECT * FROM &quot;teams&quot;`; const { records: myRecord } = await xata.sql&lt;TeamsRecord&gt;`SELECT * FROM &quot;teams&quot; WHERE name=${name}`; const { records: myRecord } = await xata.sql&lt;TeamsRecord&gt;`SELECT &quot;primaryTitle&quot;, md5(&quot;primaryTitle&quot;), avg(&quot;runtimeMinutes&quot;) FROM titles GROUP BY &quot;primaryTitle&quot;`;</pre> <pre> records = xata.sql().query(&#39;&#39;&#39;SELECT * FROM &quot;teams&quot;&#39;&#39;&#39;) records = xata.sql().query(&#39;&#39;&#39;SELECT * FROM &quot;teams&quot; WHERE name=$1&#39;&#39;&#39;, params=[name]) records = xata.sql().query(&#39;&#39;&#39;SELECT &quot;primaryTitle&quot;, md5(&quot;primaryTitle&quot;), avg(&quot;runtimeMinutes&quot;) FROM titles GROUP BY &quot;primaryTitle&quot;&#39;&#39;&#39;)</pre> <pre> // POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/sql { &quot;statement&quot;: &quot;SELECT * FROM \&quot;teams\&quot;&quot; } // POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/sql { &quot;statement&quot;: &quot;SELECT * FROM \&quot;teams\&quot; WHERE name=$&quot;, &quot;params&quot;: [&quot;name&quot;] } // POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/sql { &quot;statement&quot;: &quot;SELECT \&quot;primaryTitle\&quot;, md5(\&quot;primaryTitle\&quot;), avg(\&quot;runtimeMinutes\&quot;) FROM titles GROUP BY \&quot;primaryTitle\&quot;&quot; }</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>
Tags: HTTP ORM SQL