From 577cf29f64aa68c5a1c89e1b8d84528ed6a1cd37 Mon Sep 17 00:00:00 2001 From: Joe Nelson Date: Mon, 10 Oct 2016 01:15:33 -0700 Subject: [PATCH] Intro section --- _static/logo.png | Bin 0 -> 8149 bytes index.rst | 55 +++++++++++++++++++++++----- intro.rst | 92 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+), 9 deletions(-) create mode 100644 _static/logo.png create mode 100644 intro.rst diff --git a/_static/logo.png b/_static/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..030673cfbaa40c2bc994436ff1aa67cab3a01d0e GIT binary patch literal 8149 zcmeAS@N?(olHy`uVBq!ia0y~yVAf|~VA#mP%)r3#tGs9p0|R4TfKQ04dx1|+PY(kF z!@Ya=7#JA#?%n(0!v_Wi1~xXfZ{NP%ym|A?nKO?cKmPXZ+wR@FKY_uwZ{NOt{rc+F zs~0a`eE9I;_3PJPzkdDv`SX`AUp{~S{O;Ymw{PFR2ZJwPzI^)h>HGKZT3IuG{`~Rl z=TAuyvERRcYh+HBk&t9yVEFd!n|j9dFJHd={rmUBr!Ok$)84&%_wnN=M+b-encH8z zdeyLGzn-?vrAwESlasGKc(H%q{(a}~%$hk%K~^pQ+A_RQGGNI!3uedVImNt+|WBdV&Z?mm0#=IVC; z{{5z=riyvHw{P1P6cn^}&Dy@czRjC9y?pnnAitnz&C#>Bo;-g1c=__>r%#=F{ObLx zLsza}zrK6-?)kgUb#``cJ$ZB9ym`lu9k(o|z)>zuM>pzf{=0{{6ke%y|_T z4qiWA*V;4r?D?Ysk3KRm$bR*7aSW-5OHyF$X$myp`cZL%qdCxk%Z<_8nwgndT)#oq z`jxL#&m)6w>zK>3i zdAF!U?|Jcg_bc&=Pw%UJY#45brRh%IAl?wSre!a~jk<)jk>z)|9rPLGmhTmBh-0W? ze8IW^%!sVdc*IySWrsM!7p4m!6?>tK*=lkPy4rVPTm~@1TW$6daR%xCo5dSy8E=R) zytDnnv_YTYPUwAohToISJsH0|nq|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Um`7diG{kC0Pa`FF%AO^0Av@G{T zYu&!DoBu?pIC6;1ii|XVF;j8-Ngmj#D}6L1rqsJ14cYBI0s^P|&a_1%ip zD>la1CG4qdzhY=yy)mfyr%<6%X^iisQ#KxpVxP^J)_-ly)Watf_hnjzF+4orBcH!q z?)-+ThfgCV%(mDYe7?ST@n(77Tbc`+19=jcTvU2_)nLi02dtW}eY!O-noR#~;B@H_ z*NL(xtVeb}J^gg9v?Q zp;kZp#8W+P@%}!={iJhQtFrz)ULl6UMZYRiO@+9uS5GXz<`txDeB@~3bd$}&ar>E$ zeAf!}%rl+fHt|+8Tct#0=F@4m6C6Gy>Gs`Dc`#?UEw{j;x@Q*@K2|by&1>HK!D;W} z`CIQ-zvSGdxFM2#@AD^>o!|F3oL?ile_4cRt|p}?LMw=Gx}^onIZ?Ra*sh9hTs z_k%xQ;(q=4$2NEW2cxM#cj7&rNjp4-3ZZkm=Hd> zP-oKd$J@epEo3u4=jtJ2smgl&Gim;5JvD-#A4 zmB#`C2N%e&v}d|XIQ?LDHTbpv)rzi%n%9GmZTvp>xo3kbZ_+lYQ$WckE3| ztY3E1BIoUfxD$0}zgAB)bUEe_S$Fp5G9vEpF8)=joWd)C#bAE_Sn3O+%H(aFjZwPV%y?A`y104xBCzQ z#=Q-34*Hu{FrIx;4Ph@3zrg)sX|EKR2I&C_=PhP4x%@sZZxLHe-hS~5+!LCs7(b_O z3eYdwv{>?%d8!R(lE7#R(z|$BrC1$H4aHjZeiv j4GGr84RdAZ#4@O^wUb${QZt2tfq}u()z4*}Q$iB}o>xQ$ literal 0 HcmV?d00001 diff --git a/index.rst b/index.rst index 23b0de321..c3fbe2bcb 100644 --- a/index.rst +++ b/index.rst @@ -1,12 +1,49 @@ -.. PostgREST documentation master file, created by - sphinx-quickstart on Sun Oct 9 16:53:00 2016. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to PostgREST's documentation! -===================================== - -Contents: +.. image:: _static/logo.png .. toctree:: :maxdepth: 2 + +.. toctree:: + :caption: What is PostgREST? + + intro.rst + +.. Installation +.. Binary Release +.. Build from Source +.. Docker +.. API +.. Tables and Views +.. Filtering +.. Ordering +.. Limits and Pagination +.. Counting +.. Response Format +.. Singular or Plural +.. OpenAPI Support +.. Resource Embedding +.. Query Limitations +.. Stored Procedures +.. Insertions / Updates +.. Getting Results +.. Bulk Insert +.. Deletions +.. Authentication +.. Overview of Role System +.. JSON Web Tokens +.. Internal Generation +.. External Generation +.. SSL +.. Custom Validation +.. Schema Isolation +.. User Management +.. Logins +.. Password Reset +.. Administration +.. Block full-table operations +.. Alternate URL structure +.. API Versioning +.. HTTP Caching +.. Database Caching +.. Debugging +.. (viewing db logs) diff --git a/intro.rst b/intro.rst new file mode 100644 index 000000000..4d070f6fc --- /dev/null +++ b/intro.rst @@ -0,0 +1,92 @@ +Motivation +########## + +PostgREST is a standalone web server that turns your PostgreSQL database directly into a RESTful API. The structural constraints and permissions in the database determine the API endpoints and operations. + +Using PostgREST is an alternative to manual CRUD programming. Custom API servers suffer problems. Writing business logic often duplicates, ignores or hobbles database structure. Object-relational mapping is a leaky abstraction leading to slow imperative code. The PostgREST philosophy establishes a single declarative source of truth: the data itself. + +Declarative Programming +----------------------- + +It's easier to ask PostgreSQL to join data for you and let its query planner figure out the details than to loop through rows yourself. It's easier to assign permissions to db objects than to add guards in controllers. (This is especially true for cascading permissions in data dependencies.) It's easier set constraints than to litter code with sanity checks. + +Leakproof Abstraction +--------------------- + +There is no ORM involved. Creating new views happens in SQL with known performance implications. A database administrator can now create an API from scratch with no custom programming. + +Embracing the Relational Model +------------------------------ + +In 1970 E. F. Codd criticized the then-dominant hierarchical model of databases in his article A Relational Model of Data for Large Shared Data Banks. Reading the article reveals a striking similarity between hierarchical databases and nested http routes. With PostgREST we attempt to use flexible filtering and embedding rather than nested routes. + +One Thing Well +-------------- + +PostgREST has a focused scope. It works well with other tools like Nginx. This forces you to cleanly separate the data-centric CRUD operations from other concerns. Use a collection of sharp tools rather than building a big ball of mud. + +Shared Improvements +------------------- + +As with any open source project, we all gain from features and fixes in the tool. It's more beneficial than improvements locked inextricably within custom codebases. + +Ecosystem +######### + +PostgREST has a growing ecosystem of examples, and libraries, experiments, and users. Here is a selection. + +Client-Side Libraries +--------------------- + +* `hugomrdias/postgrest-url `_ - JS, just for generating query URLs +* `john-kelly/elm-postgrest `_ - Elm +* `mithril.postgrest `_ - JS, Mithril +* `thejettdurham/postgrest-sharp-client `_ - C#, RestSharp +* `lewisjared/postgrest-request `_ - JS, SuperAgent +* `JarvusInnovations/jarvus-postgrest-apikit `_ - JS, Sencha framework +* `davidthewatson/postgrest_python_requests_client `_ - Python +* `calebmer/postgrest-client `_ - JS + +Extensions +---------- + +* `diogob/postgrest-ws `_ - expose web sockets for PostgreSQL's LISTEN/NOTIFY +* `srid/spas `_ - allow file uploads and basic auth +* `svmnotn/postgrest-auth `_ - OAuth2-inspired external auth server +* `nblumoe/postgrest-oauth `_ - OAuth2 WAI middleware + +Example Apps +------------ + +* `CodeforAustralia/heritage-near-me `_ - Elm and PostgREST with PostGIS +* `timwis/handsontable-postgrest `_ - An excel-like database table editor +* `Recmo/PostgrestSkeleton `_ - Docker Compose, PostgREST, Nginx and Auth0 +* `benoror/ember-postgrest-dynamic-ui `_ - generating Ember forms to edit data +* `ruslantalpa/blogdemo `_ - blog api demo in a vagrant image +* `timwis/ext-postgrest-crud `_ - browser-based spreadsheet +* `srid/chronicle `_ - tracking a tree of personal memories +* `diogob/elm-workshop `_ - building a simple database query UI +* `marmelab/ng-admin-postgrest `_ - automatic database admin panel +* `myfreeweb/moneylog `_ - accounting web app in Polymer + PostgREST +* `tyrchen/goodfilm `_ - example film api +* `begriffs/postgrest-example `_ - sqitch versioning for API + +In Production +------------- + +* `Catarse `_ +* `iAdvize `_ +* `Redsmin `_ +* `Image-charts `_ +* `Drip Depot `_ + +Commercial PaaS +--------------- + +* `Sub0 `_ - Automated GraphQL & REST API with built-in caching (powered by PostgREST) + + +Getting Support +################ + +The project has a friendly and growing community. Join our `chat room `_ for discussion and help. You can also report or search for bugs/features on the Github `issues `_ page.