<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: prestd</title>
    <description>The latest articles on DEV Community by prestd (@prestd).</description>
    <link>https://dev.to/prestd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2931%2F87b1a4fc-f50f-40f6-aa3a-d535a0f2561d.png</url>
      <title>DEV Community: prestd</title>
      <link>https://dev.to/prestd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prestd"/>
    <language>en</language>
    <item>
      <title>pRESTd release 1.1.4 - Query performance improvement</title>
      <dc:creator>Vinicius Mesel</dc:creator>
      <pubDate>Tue, 08 Nov 2022 18:04:13 +0000</pubDate>
      <link>https://dev.to/prestd/prestd-release-114-query-performance-improvement-25fn</link>
      <guid>https://dev.to/prestd/prestd-release-114-query-performance-improvement-25fn</guid>
      <description>&lt;p&gt;If you want to use your database as a data source for an API you are creating, but you are not happy with building it from scratch: pRESTd is for you!&lt;/p&gt;

&lt;p&gt;Basically pRESTd is a software that enables you to perform queries through API calls on your whole database system, improving delivery time for your development team.&lt;/p&gt;

&lt;p&gt;In this new release (1.1.4), we were able to work on a performance improvement on our querying system. Our base query used to use the following query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="n"&gt;json_agg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;your_awesome_table&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which, &lt;a href="https://github.com/prest/prest/issues/730#issuecomment-1303886877"&gt;on our analysis&lt;/a&gt;, was 5x slower than using JSONB aggregation function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benchmark
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---TVZBRRB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6u642rrrtzhy0iqbn1md.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---TVZBRRB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6u642rrrtzhy0iqbn1md.png" alt="Comparison between Serialization methods on pREST codebase" width="880" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see above, implementing the functionality in Golang gives us better performance on smaller scenarios, but as we grow our data requests, the linearity of the equation is not followed.&lt;/p&gt;

&lt;p&gt;That's why we chose to implement with JSONB_AGG as our serializer on the database end, enabling us to save time on development and test writing.&lt;/p&gt;

&lt;p&gt;You can see the requests data available in our PR, on the subtitles below.&lt;/p&gt;

&lt;h3&gt;
  
  
  With JSON_AGG()
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2022/11/04 16:54:35 [warning] adapter is not set. Using the default (postgres)
2022/11/04 16:54:35 [warning] command.go:920 You are running prestd in debug mode.
[prestd] listening on 0.0.0.0:80 and serving on /
2022/11/04 16:54:41 [debug] server.go:2084 generated SQL:SELECT json_agg(s) FROM (SELECT * FROM "database"."public"."table" LIMIT 1000 OFFSET(1 - 1) * 1000) s parameters: []
[negroni] 2022-11-04T16:54:41Z | 200 |   5.11392325s | 54.186.223.54 | GET /database/public/table
2022/11/04 16:55:18 [debug] server.go:2084 generated SQL:SELECT json_agg(s) FROM (SELECT * FROM "database"."public"."table" LIMIT 100 OFFSET(1 - 1) * 100) s parameters: []
[negroni] 2022-11-04T16:55:18Z | 200 |   504.78063ms | 54.186.223.54 | GET /database/public/table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  With JSONB_AGG()
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[prestd] listening on 0.0.0.0:80 and serving on /
2022/11/04 16:59:26 [debug] server.go:2084 generated SQL:SELECT jsonb_agg(s) FROM (SELECT * FROM "database"."public"."table" LIMIT 100 OFFSET(1 - 1) * 100) s parameters: []
[negroni] 2022-11-04T16:59:26Z | 200 |   479.260256ms | 54.186.223.54 | GET /database/public/table
2022/11/04 17:00:05 [debug] server.go:2084 generated SQL:SELECT jsonb_agg(s) FROM (SELECT * FROM "database"."public"."table" LIMIT 1000 OFFSET(1 - 1) * 1000) s parameters: []
[negroni] 2022-11-04T17:00:05Z | 200 |   1.912713761s | 54.186.223.54 | GET /database/public/table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  About the benchmark
&lt;/h3&gt;

&lt;p&gt;We used a table with 56 million rows, two indexes (on the primary date and id fields) and both of the API calls (and queries) were paginated.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>prestd</category>
      <category>api</category>
    </item>
    <item>
      <title>Constant work to onboarding new members into engineering team</title>
      <dc:creator>Thiago Avelino</dc:creator>
      <pubDate>Fri, 07 Jan 2022 20:43:19 +0000</pubDate>
      <link>https://dev.to/prestd/constant-work-to-onboarding-new-members-into-engineering-team-18k0</link>
      <guid>https://dev.to/prestd/constant-work-to-onboarding-new-members-into-engineering-team-18k0</guid>
      <description>&lt;p&gt;Developing the &lt;em&gt;"onboarding"&lt;/em&gt; process for a new person in an engineering team takes a lot of dedication, and keeping this process fluid takes even more work (with as little friction as possible).&lt;/p&gt;

&lt;p&gt;This issue is challenging for any team working full time, it is even worse for Open Source projects where contributors usually work in their spare time. We should make this process as fluid as possible so that people don't get discouraged by the complexity of getting up there and testing, until they make their first pull request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure development environment
&lt;/h2&gt;

&lt;p&gt;Every developer has a different way of setting up a development environment, even if it is in a popular technology (programming language) with lots of documentation, text editor extensions (emacs, vim, vscode, ...), etc.&lt;/p&gt;

&lt;p&gt;We developers are used to “&lt;em&gt;our way”&lt;/em&gt; of doing things, it is common for us to create resistance when someone presents a different way and I do it another way.&lt;/p&gt;

&lt;p&gt;In the vast majority of applications they depend on external resources such as databases, APIs, tokens, etc., if we force the developer (user) to read all the project documentation before having the first contact with the project it is very likely that we will lose his engagement, and some frustrations in him, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I just wanted to test&lt;/li&gt;
&lt;li&gt;I have to read all this to see it working&lt;/li&gt;
&lt;li&gt;What a complicated project&lt;/li&gt;
&lt;li&gt;I have to install X, Y and Z services/software on my machine&lt;/li&gt;
&lt;li&gt;I don't know the programming language used in the project, which plugins should I install in my editor?&lt;/li&gt;
&lt;li&gt;... and much more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are some tools to assist project maintainers (open source or private) to generate an onboarding process with as little friction as possible.&lt;/p&gt;

&lt;p&gt;Configuring editor (with all the necessary plugins and parameters), all the services the project needs to run, environment variables configured, database running with initial data load, data viewer configured (software to manage data from the database), etc.&lt;/p&gt;

&lt;p&gt;To the point where the developer “&lt;strong&gt;clicks a button”&lt;/strong&gt; and magically has the development environment ready to test the software.&lt;/p&gt;

&lt;p&gt;In the last few months we at &lt;em&gt;prestd&lt;/em&gt; have been working on improving our documentation (it is far from being good documentation) and removing as much friction as possible in the process of getting a new development environment up, some issues we have implemented until we got to what we have today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/prest/prest/issues/510"&gt;Improve local tests execution&lt;/a&gt; — it is frustrating that someone wants to contribute and cannot run the local tests (we use e2e tests, making requests to &lt;em&gt;prestd&lt;/em&gt;'s own API), a way was implemented where the tests run inside docker using &lt;code&gt;docker-compose&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/prest/prest/issues/542"&gt;Documentation: new content architecture&lt;/a&gt; — thinking of a person who has never had contact with &lt;em&gt;prestd&lt;/em&gt; and wants to test or use it in a production environment, both people should get into the documentation and be able to do what they want to do (bring up the environment);&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/prest/prest/issues/665"&gt;Onboarding of new contributor: using devcontainer&lt;/a&gt; — prepare the development environment with &lt;em&gt;"1 click"&lt;/em&gt; using &lt;a href="https://code.visualstudio.com/docs/remote/containers"&gt;devcontainers&lt;/a&gt; (&lt;a href="https://github.com/features/codespaces"&gt;GitHub Codespaces&lt;/a&gt; support).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See &lt;em&gt;prestd&lt;/em&gt;'s development guide page &lt;a href="https://docs.prestd.com/prestd/setup/development-guide/#dev-container"&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is not nice to have the engineering team working in a bad environment, we need to think more about our team and make the team experience fluid.&lt;br&gt;
&lt;strong&gt;people &amp;gt; technology&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Focus on the developer (user)
&lt;/h2&gt;

&lt;p&gt;The &lt;em&gt;prestd&lt;/em&gt; exists open source since 2016, I particularly like the project very much and believe it is a great solution to accelerate the development of a RESTful API for existing database and especially development of a new API (project starting from scratch).&lt;/p&gt;

&lt;p&gt;But for many years we turned to developing the software didn't look at documentation with the dedication we should, causing the contributor base to shrink (existing and new) — people going through open source project, hardly stayed for many years, so we always have to have the most rounded onboarding process possible.&lt;/p&gt;

&lt;p&gt;Given this problem I started to look at the documentation with more dedication and every decision in &lt;em&gt;prestd&lt;/em&gt; from now on will be thinking about the developer (user) experience, answering the following questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Will this improve the developer experience using the project?&lt;/li&gt;
&lt;li&gt;Will this make the project easier to use?&lt;/li&gt;
&lt;li&gt;Will this make it easier to maintain the development of the project?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When all 3 questions are “&lt;strong&gt;yes”&lt;/strong&gt;, we will proceed with the implementation, regardless of what it is: feature, improvement, fix, etc.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>management</category>
      <category>vscode</category>
      <category>docker</category>
    </item>
    <item>
      <title>When is the best time to share a "new" product?</title>
      <dc:creator>Thiago Avelino</dc:creator>
      <pubDate>Fri, 09 Jul 2021 00:17:23 +0000</pubDate>
      <link>https://dev.to/prestd/when-is-the-best-time-to-share-a-new-product-42pl</link>
      <guid>https://dev.to/prestd/when-is-the-best-time-to-share-a-new-product-42pl</guid>
      <description>&lt;p&gt;&lt;strong&gt;Is now&lt;/strong&gt; (as soon as possible), even if it's not the way you want it&lt;/p&gt;

&lt;p&gt;pREST exists since 2016 and today I remembered to publish it on Product Hunt, without having much expectation on the engagement.&lt;/p&gt;

&lt;p&gt;To my surprise, has a much higher engagement than I imagined, especially in the installation of binary (software).&lt;/p&gt;

&lt;p&gt;We will be a software for API development based on PostgreSQL database (new or existing) with low-code, there is a lot of work to be done... we are just in the beginning.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1412956727822200835-533" src="https://platform.twitter.com/embed/Tweet.html?id=1412956727822200835"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1412956727822200835-533');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1412956727822200835&amp;amp;theme=dark"
  }



&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/prest" rel="noopener noreferrer"&gt;
        prest
      &lt;/a&gt; / &lt;a href="https://github.com/prest/prest" rel="noopener noreferrer"&gt;
        prest
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;pRESTd&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://travis-ci.com/prest/prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/9d1c731140c67a72546755b282520acd475aacf560de3c8711288a224a061cc5/68747470733a2f2f7472617669732d63692e636f6d2f70726573742f70726573742e7376673f6272616e63683d6d61696e" alt="Build Status"&gt;&lt;/a&gt;
&lt;a href="https://godoc.org/github.com/prest/prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/dacf584ec7569cafda695809c7d16519868de76ecf1530af08bcecba07dd157c/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f70726573742f70726573743f7374617475732e706e67" alt="GoDoc"&gt;&lt;/a&gt;
&lt;a href="https://goreportcard.com/report/github.com/prest/prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/2720e3c54bb6f42eaebff29f9142f3296c5782ace4eff66808a52ea46e140c2c/68747470733a2f2f676f7265706f7274636172642e636f6d2f62616467652f6769746875622e636f6d2f70726573742f7072657374" alt="Go Report Card"&gt;&lt;/a&gt;
&lt;a href="https://codecov.io/gh/prest/prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/b9d0d8434d295e51813bcdddbab8908e0f3dce42f6ecb3c1943df036557c08ec/68747470733a2f2f636f6465636f762e696f2f67682f70726573742f70726573742f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d65564439757277494576" alt="codecov"&gt;&lt;/a&gt;
&lt;a href="https://formulae.brew.sh/formula/prestd" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/bf1b2e10e7d2cf90ac58a7b9735980ff80025d7cf9c2d7243a5e6de45d8483b6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e2e7376673f75726c3d68747470733a2f2f666f726d756c61652e627265772e73682f6170692f666f726d756c612f7072657374642e6a736f6e2671756572793d242e76657273696f6e732e737461626c65266c6162656c3d686f6d6562726577" alt="Homebrew"&gt;&lt;/a&gt;
&lt;a href="https://discord.gg/JnRjvu39w8" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/02f21acd9ce6733ea133f7ba4b22a3a7401a16eee4bf5c38c53631f0c154a644/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646973636f72642d7072657374642d626c75653f6c6f676f3d646973636f7264" alt="Discord"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;p&lt;/em&gt;&lt;strong&gt;REST&lt;/strong&gt; (&lt;strong&gt;P&lt;/strong&gt;&lt;em&gt;ostgreSQL&lt;/em&gt; &lt;strong&gt;REST&lt;/strong&gt;), is a simple production-ready API, that delivers an instant, realtime, and high-performance application on top of your &lt;strong&gt;existing or new Postgres&lt;/strong&gt; database.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;PostgreSQL version 9.5 or higher&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Contributor License Agreement - &lt;a href="https://cla-assistant.io/prest/prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/ae8557d967c327ba9e1c3f54cc540e45697332ee8317d6181f5fb7369e09d1d2/68747470733a2f2f636c612d617373697374616e742e696f2f726561646d652f62616467652f70726573742f7072657374" alt="CLA assistant"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/prest?utm_source=badge-featured&amp;amp;utm_medium=badge&amp;amp;utm_souce=badge-prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/bad99537567fee744b1b3cf0b72235a6d7d28ce418cf5c614b4fae72cb4c5795/68747470733a2f2f6170692e70726f6475637468756e742e636f6d2f776964676574732f656d6265642d696d6167652f76312f66656174757265642e7376673f706f73745f69643d333033353036267468656d653d6c69676874" alt="pREST - instant, realtime, high-performance on PostgreSQL | Product Hunt" width="250" height="54"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Problems we solve&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;The pREST project is the API that addresses the need for fast and efficient solution in building RESTful APIs on PostgreSQL databases. It simplifies API development by offering:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A &lt;strong&gt;lightweight server&lt;/strong&gt; with easy configuration;&lt;/li&gt;
&lt;li&gt;Direct &lt;strong&gt;SQL queries with templating&lt;/strong&gt; in customizable URLs;&lt;/li&gt;
&lt;li&gt;Optimizations for &lt;strong&gt;high performance&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced&lt;/strong&gt; developer &lt;strong&gt;productivity&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication and authorization&lt;/strong&gt; features;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pluggable&lt;/strong&gt; custom routes and middlewares.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Overall, pREST simplifies the process of creating secure and performant RESTful APIs on top of your new or old PostgreSQL database.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/prest/prest/issues/41" rel="noopener noreferrer"&gt;Read more&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why we built pREST&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;When we built pREST, we originally intended to contribute and build with the PostgREST project, although it took a lot…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/prest/prest" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/prest" rel="noopener noreferrer"&gt;https://www.producthunt.com/posts/prest&lt;/a&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>opensource</category>
      <category>postgres</category>
      <category>graphql</category>
    </item>
    <item>
      <title>Full Text Search in PostgreSQL</title>
      <dc:creator>Thiago Avelino</dc:creator>
      <pubDate>Sat, 02 Jan 2021 19:20:54 +0000</pubDate>
      <link>https://dev.to/prestd/full-text-search-in-postgresql-4k6e</link>
      <guid>https://dev.to/prestd/full-text-search-in-postgresql-4k6e</guid>
      <description>&lt;p&gt;When the subject is search engine (inverted index) it is extremely common to think of solutions like Apache Solr or Elastic (former elasticsearch), but why don't we remember the Full Text Search feature we have native in PostgreSQL?&lt;/p&gt;

&lt;p&gt;The full text search feature in PostgreSQL became native in version 9.4, but before that we had the &lt;strong&gt;GiST Indexes&lt;/strong&gt;, which was used as the basis for the development of Full Text Search (&lt;code&gt;tsvector&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Full Text Search Anyway?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;(...) full-text search refers to techniques for searching a single computer-stored document or a collection in a full text database; (...) distinguished from searches based on metadata or on parts of the original texts represented in databases (such as titles, abstracts, selected sections, or bibliographical references). &lt;a href="https://en.wikipedia.org/wiki/Full-text_search" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In other words, imagine you have a set of text documents stored in a database. These documents are not just meta-data items like an author name or a country of origin, but rather an abstract for an article, or full text articles themselves, and you want to find out if certain words are present or not in them.&lt;/p&gt;

&lt;p&gt;E.g. you want to search all the news that has subistantive related to &lt;strong&gt;"dog"&lt;/strong&gt; or &lt;strong&gt;"fox"&lt;/strong&gt; &lt;em&gt;(we are talking about animals)&lt;/em&gt; are present so if they are in their singular form, you'll find them with the &lt;code&gt;ILIKE&lt;/code&gt; keyword...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;news&lt;/span&gt;  
&lt;span class="k"&gt;WHERE&lt;/span&gt;  
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="k"&gt;ILIKE&lt;/span&gt; &lt;span class="s1"&gt;'%fox%'&lt;/span&gt; &lt;span class="k"&gt;OR&lt;/span&gt;
&lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="k"&gt;ILIKE&lt;/span&gt; &lt;span class="s1"&gt;'%dog%'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;... but you'll also find stuff like "foxtrot" or "Dogville", which is not quite what you intended, you had to declare in which field you would search, if you did not have the terms searched in the field will not bring record.&lt;/p&gt;

&lt;p&gt;Another problem is that if you search for a word such as "query", and if it's present in its plural form "queries", then you won't find it if you try a simple pattern search with LIKE, even though the word is, in fact, there. Some of you might be thinking to use regular expressions, and yes, you could do that, regular expressions are incredibly powerful, but also terribly slow.&lt;/p&gt;

&lt;p&gt;A more effective way to approach this problem is by getting a semantic vector for all of the words contained in a document, that is, a language-specific representation of such words. So, when you search for a word like "jump", you will match all instances of the word and its tenses, even if you searched for "jumped" or "jumping". Additionally, you won't be searching the full document itself (which is slow), but the vector (which is fast).&lt;/p&gt;

&lt;p&gt;That is, in a nutshell, the principle of full text search, thinking about problems related to this was developed data type &lt;code&gt;tsvector&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  What do you need to know to use tsvector?
&lt;/h2&gt;

&lt;p&gt;PostgreSQL has two functions that do exactly what we intend to do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;to_tsvector&lt;/code&gt; for creating a list of tokens (the &lt;code&gt;tsvector&lt;/code&gt; data type, where &lt;code&gt;ts&lt;/code&gt; stands for "text search");&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;to_tsquery&lt;/code&gt; for querying the vector for occurrences of certain words or phrases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, to create a vector for the sentence &lt;em&gt;"the quick brown fox jumped over the lazy dog"&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;to_tsvector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'The quick brown fox jumped over the lazy dog.'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Which will return a vector where every token is a &lt;a href="https://en.wikipedia.org/wiki/Lexeme" rel="noopener noreferrer"&gt;lexeme&lt;/a&gt; (unit of lexical meaning) with pointers (the positions in the document), and where words that carry little meaning, such as articles (the) and conjunctions (and, or) are conveniently omitted:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                      to_tsvector
-------------------------------------------------------
 'brown':3 'dog':9 'fox':4 'jump':5 'lazi':8 'quick':2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;By default, every word is &lt;a href="https://en.wikipedia.org/wiki/Text_normalization" rel="noopener noreferrer"&gt;normalized&lt;/a&gt; as a lexeme in _English+ (e.g. "jumped" becomes "jump"), case depending on the localization settings of your PostgreSQL installation.&lt;/p&gt;

&lt;p&gt;A common doubt is about support for other languages (e.g. Brazilian Portuguese). The good news is that we have support for several languages, &lt;a href="https://www.postgresql.org/docs/current/catalog-pg-ts-config.html" rel="noopener noreferrer"&gt;see the list&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;cfgname&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;pg_ts_config&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;cfgname&lt;/span&gt;
&lt;span class="c1"&gt;--------&lt;/span&gt;
&lt;span class="k"&gt;simple&lt;/span&gt;
&lt;span class="n"&gt;arabic&lt;/span&gt;
&lt;span class="n"&gt;danish&lt;/span&gt;
&lt;span class="n"&gt;dutch&lt;/span&gt;
&lt;span class="n"&gt;english&lt;/span&gt;
&lt;span class="n"&gt;finnish&lt;/span&gt;
&lt;span class="n"&gt;french&lt;/span&gt;
&lt;span class="n"&gt;german&lt;/span&gt;
&lt;span class="n"&gt;hungarian&lt;/span&gt;
&lt;span class="n"&gt;indonesian&lt;/span&gt;
&lt;span class="n"&gt;irish&lt;/span&gt;
&lt;span class="n"&gt;italian&lt;/span&gt;
&lt;span class="n"&gt;lithuanian&lt;/span&gt;
&lt;span class="n"&gt;nepali&lt;/span&gt;
&lt;span class="n"&gt;norwegian&lt;/span&gt;
&lt;span class="n"&gt;portuguese&lt;/span&gt;
&lt;span class="n"&gt;romanian&lt;/span&gt;
&lt;span class="n"&gt;russian&lt;/span&gt;
&lt;span class="n"&gt;spanish&lt;/span&gt;
&lt;span class="n"&gt;swedish&lt;/span&gt;
&lt;span class="n"&gt;tamil&lt;/span&gt;
&lt;span class="n"&gt;turkish&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://www.postgresql.org/docs/current/textsearch-configuration.html" rel="noopener noreferrer"&gt;Deeper into the PostgreSQL text search configuration.&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Real example generating tokens
&lt;/h2&gt;

&lt;p&gt;We have &lt;strong&gt;news&lt;/strong&gt; table with title field, description and other meta data:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;news&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;title&lt;/span&gt; &lt;span class="nb"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="nb"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="k"&gt;without&lt;/span&gt; &lt;span class="nb"&gt;time&lt;/span&gt; &lt;span class="k"&gt;zone&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="n"&gt;last_update&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="k"&gt;without&lt;/span&gt; &lt;span class="nb"&gt;time&lt;/span&gt; &lt;span class="k"&gt;zone&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="n"&gt;tokens&lt;/span&gt; &lt;span class="n"&gt;tsvector&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The way it is when creating a record will not be created the tokens to do textual search, how will we solve this?&lt;/p&gt;

&lt;p&gt;We can create a trigger that listens to all the creation and updating, joins the text of the title and description and generates the tokens automatically:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;OR&lt;/span&gt; &lt;span class="k"&gt;REPLACE&lt;/span&gt; &lt;span class="k"&gt;FUNCTION&lt;/span&gt; &lt;span class="n"&gt;set_full_text_search_on_news&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;RETURNS&lt;/span&gt; &lt;span class="k"&gt;TRIGGER&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="err"&gt;$$&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
       &lt;span class="k"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tokens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;to_tsvector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;", "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
       &lt;span class="k"&gt;RETURN&lt;/span&gt; &lt;span class="k"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt;$$&lt;/span&gt; &lt;span class="k"&gt;language&lt;/span&gt; &lt;span class="s1"&gt;'plpgsql'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TRIGGER&lt;/span&gt; &lt;span class="n"&gt;update_new_full_text_search&lt;/span&gt;
       &lt;span class="k"&gt;BEFORE&lt;/span&gt; &lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;news&lt;/span&gt;
       &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="k"&gt;EACH&lt;/span&gt; &lt;span class="k"&gt;ROW&lt;/span&gt; &lt;span class="k"&gt;EXECUTE&lt;/span&gt; &lt;span class="k"&gt;PROCEDURE&lt;/span&gt; &lt;span class="n"&gt;set_full_text_search_on_news&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Inserting a Record:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;news&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'dog history'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'The quick brown fox jumped over the lazy dog'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The tokens field will be generated automatically, thus remaining:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;'caolha':&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'da':&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'de':&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'em':&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'fax':&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'gigant':&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'história':&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'java':&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'mandar':&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'new':&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'para':&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'querem':&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'york':&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'zebrazebra':&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;It is now possible to do text search using the full text search feature (function &lt;code&gt;to_tsquery&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;news&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;tokens&lt;/span&gt; &lt;span class="o"&gt;@@&lt;/span&gt; &lt;span class="n"&gt;to_tsquery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'fox'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Return:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; id |    title    |                 description                  |         created_at         |        last_update         | client_id |                                 tokens
----+-------------+----------------------------------------------+----------------------------+----------------------------+-----------+------------------------------------------------------------------------
  1 | dog history | The quick brown fox jumped over the lazy dog | 2020-12-11 15:58:55.298558 | 2021-01-02 16:05:21.088482 |         1 | 'brown':4 'dog':1,10 'fox':5 'historyth':2 'jump':6 'lazi':9 'quick':3
(1 row)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  How to use this feature in pREST?
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/prest" rel="noopener noreferrer"&gt;
        prest
      &lt;/a&gt; / &lt;a href="https://github.com/prest/prest" rel="noopener noreferrer"&gt;
        prest
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;pRESTd&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href="https://travis-ci.com/prest/prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/9d1c731140c67a72546755b282520acd475aacf560de3c8711288a224a061cc5/68747470733a2f2f7472617669732d63692e636f6d2f70726573742f70726573742e7376673f6272616e63683d6d61696e" alt="Build Status"&gt;&lt;/a&gt;
&lt;a href="https://godoc.org/github.com/prest/prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/dacf584ec7569cafda695809c7d16519868de76ecf1530af08bcecba07dd157c/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f70726573742f70726573743f7374617475732e706e67" alt="GoDoc"&gt;&lt;/a&gt;
&lt;a href="https://goreportcard.com/report/github.com/prest/prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/2720e3c54bb6f42eaebff29f9142f3296c5782ace4eff66808a52ea46e140c2c/68747470733a2f2f676f7265706f7274636172642e636f6d2f62616467652f6769746875622e636f6d2f70726573742f7072657374" alt="Go Report Card"&gt;&lt;/a&gt;
&lt;a href="https://codecov.io/gh/prest/prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/b9d0d8434d295e51813bcdddbab8908e0f3dce42f6ecb3c1943df036557c08ec/68747470733a2f2f636f6465636f762e696f2f67682f70726573742f70726573742f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d65564439757277494576" alt="codecov"&gt;&lt;/a&gt;
&lt;a href="https://formulae.brew.sh/formula/prestd" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/bf1b2e10e7d2cf90ac58a7b9735980ff80025d7cf9c2d7243a5e6de45d8483b6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e2e7376673f75726c3d68747470733a2f2f666f726d756c61652e627265772e73682f6170692f666f726d756c612f7072657374642e6a736f6e2671756572793d242e76657273696f6e732e737461626c65266c6162656c3d686f6d6562726577" alt="Homebrew"&gt;&lt;/a&gt;
&lt;a href="https://discord.gg/JnRjvu39w8" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/02f21acd9ce6733ea133f7ba4b22a3a7401a16eee4bf5c38c53631f0c154a644/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646973636f72642d7072657374642d626c75653f6c6f676f3d646973636f7264" alt="Discord"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;p&lt;/em&gt;&lt;strong&gt;REST&lt;/strong&gt; (&lt;strong&gt;P&lt;/strong&gt;&lt;em&gt;ostgreSQL&lt;/em&gt; &lt;strong&gt;REST&lt;/strong&gt;), is a simple production-ready API, that delivers an instant, realtime, and high-performance application on top of your &lt;strong&gt;existing or new Postgres&lt;/strong&gt; database.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;PostgreSQL version 9.5 or higher&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Contributor License Agreement - &lt;a href="https://cla-assistant.io/prest/prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/ae8557d967c327ba9e1c3f54cc540e45697332ee8317d6181f5fb7369e09d1d2/68747470733a2f2f636c612d617373697374616e742e696f2f726561646d652f62616467652f70726573742f7072657374" alt="CLA assistant"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/prest?utm_source=badge-featured&amp;amp;utm_medium=badge&amp;amp;utm_souce=badge-prest" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/bad99537567fee744b1b3cf0b72235a6d7d28ce418cf5c614b4fae72cb4c5795/68747470733a2f2f6170692e70726f6475637468756e742e636f6d2f776964676574732f656d6265642d696d6167652f76312f66656174757265642e7376673f706f73745f69643d333033353036267468656d653d6c69676874" alt="pREST - instant, realtime, high-performance on PostgreSQL | Product Hunt" width="250" height="54"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Problems we solve&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;The pREST project is the API that addresses the need for fast and efficient solution in building RESTful APIs on PostgreSQL databases. It simplifies API development by offering:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A &lt;strong&gt;lightweight server&lt;/strong&gt; with easy configuration;&lt;/li&gt;
&lt;li&gt;Direct &lt;strong&gt;SQL queries with templating&lt;/strong&gt; in customizable URLs;&lt;/li&gt;
&lt;li&gt;Optimizations for &lt;strong&gt;high performance&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced&lt;/strong&gt; developer &lt;strong&gt;productivity&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication and authorization&lt;/strong&gt; features;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pluggable&lt;/strong&gt; custom routes and middlewares.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Overall, pREST simplifies the process of creating secure and performant RESTful APIs on top of your new or old PostgreSQL database.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/prest/prest/issues/41" rel="noopener noreferrer"&gt;Read more&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why we built pREST&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;When we built pREST, we originally intended to contribute and build with the PostgREST project, although it took a lot…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/prest/prest" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;This feature was implemented in &lt;a href="https://github.com/prest/prest/milestone/11" rel="noopener noreferrer"&gt;version 1.0.5&lt;/a&gt; as a search filter and works like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /{DATAVASE}/{SCHEMA}/news?tokens:tsquery=fox 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dog history"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"The quick brown fox jumped over the lazy dog"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"created_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2020-12-11T15:58:55.298558"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"last_update"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2021-01-02T16:05:21.088482"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"client_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"'brown':4 'dog':1,10 'fox':5 'historyth':2 'jump':6 'lazi':9 'quick':3"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read more about pREST search filters &lt;a href="https://docs.postgres.rest/query-statements/#filter-where" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>opensource</category>
      <category>elasticsearch</category>
      <category>database</category>
    </item>
    <item>
      <title>Difference between INSERT and COPY in PostgreSQL</title>
      <dc:creator>Thiago Avelino</dc:creator>
      <pubDate>Wed, 30 Dec 2020 21:13:42 +0000</pubDate>
      <link>https://dev.to/prestd/difference-between-insert-and-copy-in-postgresql-1ifc</link>
      <guid>https://dev.to/prestd/difference-between-insert-and-copy-in-postgresql-1ifc</guid>
      <description>&lt;p&gt;Quite a number of reasons, actually, but the main ones are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Typically, client applications wait for confirmation of one &lt;code&gt;INSERT&lt;/code&gt;'s success before sending the next. So there's a round-trip delay for each &lt;code&gt;INSERT&lt;/code&gt;, scheduling delays, etc (pREST supports pipelineing INSERTs in batches). This point is the most significant, It's all about network round-trips and rescheduling delays;&lt;/li&gt;
&lt;li&gt;Each &lt;code&gt;INSERT&lt;/code&gt; has to go through the whole executor. Use of a prepared statement bypasses the need to run the parser, rewriter and planner, but there's still executor state to set up and tear down for each row. &lt;code&gt;COPY&lt;/code&gt; does some setup once, and has an extremely low overhead for each row, especially where no triggers are involved.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  pREST of COPY batches "INSERT's" support?
&lt;/h2&gt;

&lt;p&gt;Yes, we support the insertion operation using &lt;code&gt;COPY&lt;/code&gt; when explained in the http protocol header.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Prest-Batch-Method: copy&lt;/code&gt;, when not declared pREST will use &lt;code&gt;INSERT&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.postgres.rest/batch-operations/"&gt;read more at.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>database</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
    <item>
      <title>pREST Celebrating 2,441 GitHub Stars ✨</title>
      <dc:creator>Thiago Avelino</dc:creator>
      <pubDate>Wed, 11 Nov 2020 19:44:50 +0000</pubDate>
      <link>https://dev.to/prestd/prest-celebrating-2-441-github-stars-9ln</link>
      <guid>https://dev.to/prestd/prest-celebrating-2-441-github-stars-9ln</guid>
      <description>&lt;p&gt;pREST just received it's &lt;a href="https://github.com/prest/prest"&gt;2,441th star on GitHub&lt;/a&gt;. We'll use this milestone to recap pREST’s growth and other important milestones since its beginning as an experimental project in 2016. We've accomplished lot of great things together.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/prest"&gt;
        prest
      &lt;/a&gt; / &lt;a href="https://github.com/prest/prest"&gt;
        prest
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1 id="user-content--prestd"&gt;&lt;a class="heading-link" href="https://github.com/prest/prest#-prestd"&gt;&lt;img src="https://camo.githubusercontent.com/46ae6b60c9489ed1e9acb5b175397a1f0dc13336e9845c2d4edb29c331e38297/68747470733a2f2f646f63732e7072657374642e636f6d2f6c6f676f2e706e67" alt="RESTful API" title="RESTful API"&gt; prestd&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://travis-ci.com/prest/prest" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/4c8498cf30582894fde2ee192ae0d6754b12169258c39e0190037bdb75d99511/68747470733a2f2f7472617669732d63692e636f6d2f70726573742f70726573742e7376673f6272616e63683d6d61696e" alt="Build Status"&gt;&lt;/a&gt;
&lt;a href="https://godoc.org/github.com/prest/prest" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/ed439e448b4589ce43941820408b3748cf67c44a8bfa986eee938aee551ffe26/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f70726573742f70726573743f7374617475732e706e67" alt="GoDoc"&gt;&lt;/a&gt;
&lt;a href="https://goreportcard.com/report/github.com/prest/prest" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/a44e02070085a4c6d91c0f81ea8491ef939ac779bc899ce2898a14ccf0fc82c8/68747470733a2f2f676f7265706f7274636172642e636f6d2f62616467652f6769746875622e636f6d2f70726573742f7072657374" alt="Go Report Card"&gt;&lt;/a&gt;
&lt;a href="https://codecov.io/gh/prest/prest" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/dc0c1067933a083c4ac89ae54f8b8f01cf93514425816b05b0e3ee833523fb73/68747470733a2f2f636f6465636f762e696f2f67682f70726573742f70726573742f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d65564439757277494576" alt="codecov"&gt;&lt;/a&gt;
&lt;a href="https://formulae.brew.sh/formula/prestd" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/e4da1f5bab77e151b27c8b4f007f7b62736fc3543ad221617421813e69a80036/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e2e7376673f75726c3d68747470733a2f2f666f726d756c61652e627265772e73682f6170692f666f726d756c612f7072657374642e6a736f6e2671756572793d242e76657273696f6e732e737461626c65266c6162656c3d686f6d6562726577" alt="Homebrew"&gt;&lt;/a&gt;
&lt;a href="https://discord.gg/JnRjvu39w8" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/aa16280f3a77fc1ed66a513c7dd3f46fa5324b31f0ccaf16864787b6cd4ce13d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646973636f72642d7072657374642d626c75653f6c6f676f3d646973636f7264" alt="Discord"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;p&lt;/em&gt;&lt;strong&gt;REST&lt;/strong&gt; (&lt;strong&gt;P&lt;/strong&gt;&lt;em&gt;ostgreSQL&lt;/em&gt; &lt;strong&gt;REST&lt;/strong&gt;), simplify and accelerate development, instant, realtime, high-performance on any &lt;strong&gt;Postgres&lt;/strong&gt; application, &lt;strong&gt;existing or new&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;PostgreSQL version 9.5 or higher&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Contributor License Agreement - &lt;a href="https://cla-assistant.io/prest/prest" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/dd441f95620f7aae415c9b105b127e250fbf3273f941d7a6540863ed18a08e08/68747470733a2f2f636c612d617373697374616e742e696f2f726561646d652f62616467652f70726573742f7072657374" alt="CLA assistant"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/prest?utm_source=badge-featured&amp;amp;utm_medium=badge&amp;amp;utm_souce=badge-prest" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/4a88f9fc2e5a5d033be5d30e566a3b9d55b7c267fe3bc2587182940f146a9966/68747470733a2f2f6170692e70726f6475637468756e742e636f6d2f776964676574732f656d6265642d696d6167652f76312f66656174757265642e7376673f706f73745f69643d333033353036267468656d653d6c69676874" alt="pREST - instant, realtime, high-performance on PostgreSQL | Product Hunt" width="250" height="54"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="user-content-problem"&gt;&lt;a class="heading-link" href="https://github.com/prest/prest#problem"&gt;Problem&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There is PostgREST written in Haskell, but keeping Haskell software in production is not an easy job. With this need prestd was born. &lt;a href="https://github.com/prest/prest/issues/41"&gt;Read more&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="user-content-test-using-docker"&gt;&lt;a class="heading-link" href="https://github.com/prest/prest#test-using-docker"&gt;Test using Docker&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;To simplify the process of bringing up the test environment we will use &lt;strong&gt;docker-compose&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Download docker compose file&lt;/span&gt;
wget https://raw.githubusercontent.com/prest/prest/main/docker-compose-prod.yml -O docker-compose.yml
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Up (run) PostgreSQL and prestd&lt;/span&gt;
docker-compose up
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Run data migration to create user structure for access (JWT)&lt;/span&gt;
docker-compose &lt;span class="pl-c1"&gt;exec&lt;/span&gt; prest prestd migrate up auth

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Create user and password for API access (via JWT)&lt;/span&gt;
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;# user: prest&lt;/span&gt;
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;# pass: prest&lt;/span&gt;
docker-compose &lt;span class="pl-c1"&gt;exec&lt;/span&gt; postgres psql -d prest -U prest -c &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;INSERT INTO prest_users (name, username, password) VALUES ('pREST Full Name', 'prest', MD5('prest'))&lt;/span&gt;&lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/prest/prest"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;While tracking the success of an open source project is known to be a hard problem, we've a few metrics available to us. Currently 42 developers have contributed to some of the 1239 commits of the pREST repository made available in 20 releases. And this is only data from the main pREST repo.&lt;/p&gt;

&lt;p&gt;The number of stars of a GitHub project is yet another indicator, because it means people are adding the project to their list of favorites. However, people that starred pREST are not necessarily users and many users don’t star pREST (if that applies to you, consider giving us a star!), therefore its not a precise metric. Till date pREST has 50k+ all-time users during the span of an year. Which includes ~4k+ monthly users.&lt;/p&gt;

&lt;p&gt;Milestones like this are proud moments for the developers &amp;amp; community, help motivate more work &amp;amp; new developments. If you'd like to support pREST open source project, consider looking at the discussion page on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZfG9ADMp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/9v83rlownt58v8nz6asq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZfG9ADMp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/9v83rlownt58v8nz6asq.png" alt="pREST GitHub Stars" width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This will be added to the greatest moment's timeline.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Immense thanks to all the contributors who dedicated part of their time to contribute to the project. &lt;a href="https://github.com/felipeweb"&gt;Felipe Oliveira&lt;/a&gt; for starting this project with me in 2016, his experience in software engineering and staying active until today.&lt;/p&gt;

</description>
      <category>go</category>
      <category>opensource</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
