{"id":83649,"date":"2020-06-02T07:42:21","date_gmt":"2020-06-02T05:42:21","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/database-as-sode-experience"},"modified":"2020-06-02T07:42:21","modified_gmt":"2020-06-02T05:42:21","slug":"database-as-sode-experience","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/database-as-sode-experience","title":{"rendered":"Eksperienca \u00abDatabase as Code\u00bb","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Eksperienca \u00abDatabase as Code\u00bb\" src=\"\/wp-content\/uploads\/2020\/06\/a1ac23deeded97559fbe787ed09184a5.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>SQL, \u00e7far\u00eb mund t\u00eb jet\u00eb m\u00eb e thjesht\u00eb? \u00c7do prej nesh mund t\u00eb shkruaj\u00eb nj\u00eb k\u00ebrkes\u00eb t\u00eb thjesht\u00eb \u2014 shkruajm\u00eb <strong><em>select<\/em><\/strong>, rendisim kolonat e nevojshme, pastaj <strong><em>from<\/em><\/strong>, emri i tabel\u00ebs, pak kushte n\u00eb <strong><em>where<\/em><\/strong> dhe gjith\u00e7ka \u2014 t\u00eb dh\u00ebna t\u00eb dobishme kemi n\u00eb xhep, ndonj\u00ebher\u00eb (gati) pa marr\u00eb parasysh se cila DBMS \u00ebsht\u00eb n\u00eb sfond (apo ndoshta <noindex><a rel=\"nofollow\" href=\"https:\/\/osquery.io\/\">nuk \u00ebsht\u00eb nj\u00eb DBMS fare<\/a><\/noindex>). Si n\u00eb rezultat, puna me pothuajse \u00e7do burim t\u00eb dh\u00ebnash (relacional dhe jo vet\u00ebm) mund t\u00eb shqyrtohet nga k\u00ebndv\u00ebshtrimi i kodit t\u00eb zakonsh\u00ebm (me t\u00eb gjitha pasojat \u2014 kontrolli i versioneve, rishikimi i kodit, analiza statike, testet automatike dhe gjith\u00eb kjo). Kjo nuk i p\u00ebrket vet\u00ebm t\u00eb dh\u00ebnave vet\u00eb, skemave dhe migroveve, por n\u00eb p\u00ebrgjith\u00ebsi t\u00eb gjith\u00eb aktiviteteve t\u00eb depozitimit. N\u00eb k\u00ebt\u00eb artikull do t\u00eb flasim p\u00ebr detyrat dhe problemet e p\u00ebrditshme q\u00eb lidhen me pun\u00ebn me baza t\u00eb ndryshme t\u00eb dh\u00ebnash n\u00ebn lentet e \"database as code\".<\/p>\n<p><\/p>\n<p>Dhe do t\u00eb fillojm\u00eb me <noindex><a rel=\"nofollow\" href=\"https:\/\/www.yegor256.com\/2014\/12\/01\/orm-offensive-anti-pattern.html\">ORM<\/a><\/noindex>. Betejat e para t\u00eb llojit \"SQL vs ORM\" u vun\u00eb re q\u00eb n\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/www.sql.ru\/forum\/904343\/orm-vs-sql\">Rusin\u00eb para Pjetrit<\/a><\/noindex>.<\/p>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h5 id=\"obektno-relyacionnyy-maping\">Mapimi objekt-relacional<\/h5>\n<p><\/p>\n<p>P\u00ebrkrah\u00ebsit e ORM zakonisht e vler\u00ebsojn\u00eb shpejt\u00ebsin\u00eb dhe thjesht\u00ebsin\u00eb e zhvillimit, pavar\u00ebsin\u00eb nga DBMS dhe past\u00ebrtin\u00eb e kodit. P\u00ebr shum\u00eb prej nesh, kodi i pun\u00ebs me DB (dhe shpesh vet\u00eb DB)<\/p>\n<p><\/p>\n<p>                        <b class=\"spoiler_title\">zakonisht duket p\u00ebraf\u00ebrsisht k\u00ebshtu\u2026<\/b><\/p>\n<pre><code class=\"java\">@Entity\n@Table(name = \"stock\", catalog = \"maindb\", uniqueConstraints = {\n        @UniqueConstraint(columnNames = \"STOCK_NAME\"),\n        @UniqueConstraint(columnNames = \"STOCK_CODE\") })\npublic class Stock implements java.io.Serializable {\n\n    @Id\n    @GeneratedValue(strategy = IDENTITY)\n    @Column(name = \"STOCK_ID\", unique = true, nullable = false)\n    public Integer getStockId() {\n        return this.stockId;\n    }\n  ...<\/code><\/pre>\n<p><\/p>\n<p>Modeli \u00ebsht\u00eb mbushur me annotime t\u00eb zgjuara, nd\u00ebrsa diku pas skenave ORM-i trim gjeneron dhe ekzekuton ton me ndonj\u00eb SQL. N\u00eb fakt, zhvilluesit po p\u00ebrpiqen n\u00eb \u00e7do m\u00ebnyr\u00eb t\u00eb t\u00ebrheqin veten nga baza e t\u00eb dh\u00ebnave t\u00eb tyre me kilometra abstraksionesh, q\u00eb flet p\u00ebr nj\u00eb far\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/www.sql.ru\/forum\/1303231\/prichiny-nenavisti-k-yazyku-sql\">\"SQL e urrejtur\"<\/a><\/noindex>.<\/p>\n<p><\/p>\n<p>N\u00eb an\u00ebn tjet\u00ebr t\u00eb barricad\u00ebs, mb\u00ebshtet\u00ebsit e SQL-it t\u00eb past\u00ebr \"handmade\" n\u00ebnvizojn\u00eb mund\u00ebsin\u00eb p\u00ebr t\u00eb nxjerr\u00eb maksimumin nga DBMS-i i tyre pa pengesa dhe abstraksione t\u00eb dor\u00ebs s\u00eb tret\u00eb. Kjo \u00e7on n\u00eb shfaqjen e projekteve \"data-centric\" ku baza e t\u00eb dh\u00ebnave trajtohet nga individ\u00eb t\u00eb trajnuar specifikisht (ata jan\u00eb \"bazaist\u00eb\", \"bazovik\u00eb\", \"bazd\u00ebnj\u00ebs\" etj.), nd\u00ebrsa zhvilluesit vet\u00ebm duhet t\u00eb \"t\u00ebrheqin\" pamjet dhe procedurat e ruajtura, pa hyr\u00eb n\u00eb detaje.<\/p>\n<p><\/p>\n<p>E \u00e7far\u00eb n\u00ebse marrim m\u00eb t\u00eb mir\u00ebn nga t\u00eb dy bot\u00ebt? Si \u00ebsht\u00eb b\u00ebr\u00eb n\u00eb mjetin e mrekulluesh\u00ebm me nj\u00eb em\u00ebr q\u00eb afirmon jet\u00ebn <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/krisajenkins\/yesql\">Yesql<\/a><\/noindex>. Do t'ju jap disa fjal\u00eb nga koncepti i p\u00ebrgjithsh\u00ebm n\u00eb p\u00ebrkthimin tim t\u00eb lir\u00eb, nd\u00ebrsa mund t\u00eb njihet m\u00eb n\u00eb detaje. <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/krisajenkins\/yesql#rationale\">k\u00ebtu<\/a><\/noindex>.<\/p>\n<p><\/p>\n<blockquote><p>Clojure \u00ebsht\u00eb nj\u00eb gjuh\u00eb e shk\u00eblqyer p\u00ebr krijimin e DSL-ve, por SQL \u00ebsht\u00eb vet\u00eb nj\u00eb DSL i shk\u00eblqyer dhe nuk na nevojitet nj\u00eb tjet\u00ebr. S-shprehjet jan\u00eb t\u00eb bukura, por k\u00ebtu ato nuk sjellin asgj\u00eb t\u00eb re. N\u00eb fund, marrim kllapa p\u00ebr kllapa. Nuk jeni dakord? At\u00ebher\u00eb prisni q\u00eb abstraksioni mbi DB-n\u00eb t\u00eb ket\u00eb nj\u00eb rrjedhje dhe do t\u00eb filloni luft\u00ebn me funksionin. <em>(raw-sql)<\/em><\/p>\n<p>Dhe \u00e7far\u00eb duhet t\u00eb b\u00ebjm\u00eb? Le t\u00eb l\u00ebm\u00eb SQL-in si SQL-in e zakonsh\u00ebm \u2014 nj\u00eb skedar p\u00ebr nj\u00eb k\u00ebrkes\u00eb:<\/p><\/blockquote>\n<p><\/p>\n<pre><code class=\"sql\">-- emri: p\u00ebrdoruesit sipas vendit\nselect *\n  from users\n where country_code = :country_code<\/code><\/pre>\n<p><\/p>\n<blockquote><p>\u2026 dhe pastaj lexoni k\u00ebt\u00eb skedar, duke e shnd\u00ebrruar at\u00eb n\u00eb nj\u00eb funksion t\u00eb zakonsh\u00ebm Clojure:<\/p><\/blockquote>\n<p><\/p>\n<pre><code class=\"lisp\">(defqueries \"some\/where\/users_by_country.sql\"\n   {:connection db-spec})\n\n;;; Nj\u00eb funksion me emrin `users-by-country` \u00ebsht\u00eb krijuar.\n;;; Le ta p\u00ebrdorim:\n(users-by-country {:country_code \"GB\"})\n;=&gt; ({:name \"Kris\" :country_code \"GB\" ...} ...)<\/code><\/pre>\n<p><\/p>\n<blockquote><p>Duke ndjekur parimin \"SQL ve\u00e7mas, Clojure ve\u00e7mas\", ju fitoni:<\/p>\n<ul>\n<li>Asnj\u00eb surpriz\u00eb sintaksore. Baza juaj e t\u00eb dh\u00ebnave (si \u00e7do tjet\u00ebr) nuk i p\u00ebrmbush standardet SQL 100% \u2014 por p\u00ebr Yesql kjo nuk ka r\u00ebnd\u00ebsi. Ju kurr\u00eb nuk do t\u00eb humbni koh\u00eb duke k\u00ebrkuar funksione me sintaks\u00eb t\u00eb barabart\u00eb me SQL. Ju kurr\u00eb nuk do t'i ktheheni funksionit. <em>(raw-sql \"some ('funky' :: SYNTAX)\")<\/em>.<\/li>\n<li>Mb\u00ebshtetje e shk\u00eblqyer p\u00ebr redaktorin. Redaktori juaj tashm\u00eb ka nj\u00eb mb\u00ebshtetje t\u00eb shk\u00eblqyer p\u00ebr SQL. Duke ruajtur SQL si SQL, thjesht mund ta p\u00ebrdorni at\u00eb.<\/li>\n<li>P\u00ebrputhshm\u00ebri e komandave. DBA-t\u00eb tuaj mund t\u00eb lexojn\u00eb dhe shkruajn\u00eb SQL q\u00eb po p\u00ebrdorni n\u00eb projektin tuaj Clojure.<\/li>\n<li>Konfigurim m\u00eb i thjesht\u00eb i performanc\u00ebs. Duhet t\u00eb nd\u00ebrtosh nj\u00eb plan p\u00ebr nj\u00eb pyetje problematike? Kjo nuk \u00ebsht\u00eb problem, kur pyetja juaj \u00ebsht\u00eb nj\u00eb SQL i zakonsh\u00ebm.<\/li>\n<li>Rib\u00ebrja e pyetjeve. T\u00ebrhiqni k\u00ebto t\u00eb nj\u00ebjtat skedare SQL n\u00eb projekte t\u00eb tjera, sepse ky \u00ebsht\u00eb thjesht SQL-i i vjet\u00ebr i mir\u00eb \u2014 thjesht ndani at\u00eb.<\/li>\n<\/ul>\n<p>\n<\/p><\/blockquote>\n<p>Mendimi im \u00ebsht\u00eb shum\u00eb i ftoht\u00eb dhe nj\u00ebkoh\u00ebsisht shum\u00eb i thjesht\u00eb, duke b\u00ebr\u00eb q\u00eb projekti t\u00eb fitoj\u00eb shum\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/krisajenkins\/yesql#other-languages\">ndjek\u00ebsve<\/a><\/noindex> n\u00eb shum\u00eb gjuh\u00eb t\u00eb ndryshme. Dhe ne do t\u00eb p\u00ebrpiqemi t\u00eb aplikojm\u00eb nj\u00eb filozofi t\u00eb ngjashme t\u00eb ndarjes s\u00eb kodit SQL nga e gjith\u00eb e tjera, larg nga ORM.<\/p>\n<p><\/p>\n<h5 id=\"ide--db-menedzhery\">IDE &amp; DB-menaxher\u00eb<\/h5>\n<p><\/p>\n<p>Le t\u00eb fillojm\u00eb me nj\u00eb detyr\u00eb t\u00eb thjesht\u00eb t\u00eb p\u00ebrditshme. Shpesh, na duhet t\u00eb k\u00ebrkojm\u00eb objekte t\u00eb caktuara n\u00eb DB, p\u00ebr shembull, t\u00eb gjejm\u00eb nj\u00eb tabel\u00eb n\u00eb skem\u00eb dhe t\u00eb studiojm\u00eb struktur\u00ebn e saj (cilat jan\u00eb kolonat, \u00e7el\u00ebsat, indekset, kufizimet dhe t\u00eb tjera). Dhe nga \u00e7do IDE grafik ose nj\u00eb DB-manager i vog\u00ebl, n\u00eb radh\u00eb t\u00eb par\u00eb, presim pik\u00ebrisht k\u00ebto aft\u00ebsi. T\u00eb jet\u00eb e shpejt\u00eb dhe t\u00eb mos presim gjysm\u00eb ore derisa t\u00eb shfaqet dritarja me informacionin e nevojsh\u00ebm (sidomos me nj\u00eb lidhje t\u00eb ngadalshme me DB t\u00eb larg\u00ebt), dhe gjithashtu q\u00eb informacioni q\u00eb merret t\u00eb jet\u00eb i fresk\u00ebt dhe aktual, jo nj\u00eb pleh i ruajtur. P\u00ebr m\u00eb tep\u00ebr, sa m\u00eb i nd\u00ebrlikuar dhe m\u00eb i madh t\u00eb jet\u00eb DB-ja dhe m\u00eb shum\u00eb q\u00eb jan\u00eb, aq m\u00eb e v\u00ebshtir\u00eb \u00ebsht\u00eb ta b\u00ebsh k\u00ebt\u00eb.<\/p>\n<p><\/p>\n<p>Por zakonisht, un\u00eb e hedh miun diku dhe thjesht shkruaj kod. Le t\u00eb supozojm\u00eb se na nevojitet t\u00eb dim\u00eb cilat tabela (dhe me cilat karakteristika) gjenden n\u00eb skem\u00ebn \"HR\". N\u00eb shumic\u00ebn e DBMS-ve, rezultatin e k\u00ebrkuar mund ta arrijm\u00eb me nj\u00eb query t\u00eb till\u00eb t\u00eb thjesht\u00eb nga information_schema:<\/p>\n<p><\/p>\n<pre><code class=\"sql\">select table_name\n     , ...\n  from information_schema.tables\n where schema = 'HR'<\/code><\/pre>\n<p><\/p>\n<p>Nga baza n\u00eb baz\u00eb, p\u00ebrmbajtja e tabelave-referenc\u00eb variaton n\u00eb var\u00ebsi t\u00eb kapacitetit t\u00eb secil\u00ebs DBMS. P\u00ebr shembull, p\u00ebr MySQL, nga kjo referenc\u00eb mund t\u00eb merret parametra specifike p\u00ebr k\u00ebt\u00eb DBMS:<\/p>\n<p><\/p>\n<pre><code class=\"sql\">select table_name\n     , storage_engine -- Motori i p\u00ebrdorur (\"MyISAM\", \"InnoDB\" etj)\n     , row_format     -- Formati i rreshtit (\"Fixed\", \"Dynamic\" etj)\n     , ...\n  from information_schema.tables\n where schema = 'HR'<\/code><\/pre>\n<p><\/p>\n<p>Oracle nuk e ka information_schema, por ka <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Oracle_metadata\">metadata Oracle<\/a><\/noindex>, dhe nuk ka probleme t\u00eb m\u00ebdha:<\/p>\n<p><\/p>\n<pre><code class=\"sql\">select table_name\n     , pct_free       -- Minimumi i hap\u00ebsir\u00ebs s\u00eb lir\u00eb n\u00eb bllokun e t\u00eb dh\u00ebnave (%)\n     , pct_used       -- Minimumi i hap\u00ebsir\u00ebs s\u00eb p\u00ebrdorur n\u00eb bllokun e t\u00eb dh\u00ebnave (%)\n     , last_analyzed  -- Data e fundit e mbledhjes s\u00eb statistikave\n     , ...\n  from all_tables\n where owner = 'HR'<\/code><\/pre>\n<p><\/p>\n<p>As ClickHouse nuk \u00ebsht\u00eb p\u00ebrjashtim:<\/p>\n<p><\/p>\n<pre><code class=\"sql\">zgjidh emrin\n     , motori -- Motori i p\u00ebrdorur (\"MergeTree\", \"Dictionary\" etj)\n     , ...\n  nga sistem.tables\n ku databaza = 'HR'<\/code><\/pre>\n<p><\/p>\n<p>Di\u00e7ka e ngjashme mund t\u00eb b\u00ebhet edhe n\u00eb Cassandra (ku ka columnfamilies n\u00eb vend t\u00eb tables dhe keyspace'\u00eb n\u00eb vend t\u00eb skemave):<\/p>\n<p><\/p>\n<pre><code class=\"sql\">select columnfamily_name\n     , compaction_strategy_class  -- Strategjia e mbledhjes s\u00eb mbeturinave\n     , gc_grace_seconds           -- Koha e jet\u00ebs s\u00eb mbeturinave\n     , ...\n  from system.schema_columnfamilies\n where keyspace_name = 'HR'<\/code><\/pre>\n<p><\/p>\n<p>P\u00ebr shumic\u00ebn e DB-ve t\u00eb tjera mund t\u00eb merren gjithashtu k\u00ebrkesa t\u00eb ngjashme (madje edhe n\u00eb Mongo ka <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.mongodb.com\/manual\/reference\/system-collections\/#%3Cdatabase%3E.system.namespaces\">nj\u00eb koleksion sistemik special<\/a><\/noindex>, i cili p\u00ebrmban informacion p\u00ebr t\u00eb gjitha koleksionet n\u00eb sistem).<\/p>\n<p><\/p>\n<p>Natyrisht, me k\u00ebt\u00eb metod\u00eb mund t\u00eb merrni informacion jo vet\u00ebm p\u00ebr tabelat, por p\u00ebr \u00e7do objekt t\u00eb p\u00ebrgjithsh\u00ebm. Her\u00eb pas here, njer\u00ebz t\u00eb dashur ndajn\u00eb nj\u00eb kod t\u00eb till\u00eb p\u00ebr baza t\u00eb ndryshme t\u00eb dh\u00ebnash, si\u00e7 \u00ebsht\u00eb seria e artikujve n\u00eb Habr \"Funksionet p\u00ebr dokumentimin e bazave t\u00eb t\u00eb dh\u00ebnave PostgreSQL\" (<noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/post\/415575\">aib<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/post\/415897\">ben<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/post\/418597\">gim<\/a><\/noindex>). Natyrisht, mbajtja e gjith\u00eb k\u00ebsaj ngarkese k\u00ebrkesash n\u00eb mendje dhe jatkuar ti shkruani ato \u00ebsht\u00eb \"nj\u00eb djal\u00eb\" k\u00ebnaq\u00ebsi, prandaj n\u00eb IDE\/n\u00eb redaktorin tim t\u00eb preferuar kam nj\u00eb grup t\u00eb p\u00ebrgatitur m\u00eb par\u00eb t\u00eb snippeteve p\u00ebr k\u00ebrkesat m\u00eb t\u00eb p\u00ebrdorura, dhe \u00ebsht\u00eb vet\u00ebm \u00e7\u00ebshtje t\u00eb shtypni emrat e objekteve n\u00eb shabllon.<\/p>\n<p><\/p>\n<p>Si rezultat, ky m\u00ebnyr\u00eb navigimi dhe k\u00ebrkimi t\u00eb objekteve \u00ebsht\u00eb shum\u00eb m\u00eb fleksib\u00ebl, kursen shum\u00eb koh\u00eb, lejon marrjen e informacionit t\u00eb sakt\u00eb dhe n\u00eb form\u00ebn q\u00eb \u00ebsht\u00eb e nevojshme (si\u00e7 p\u00ebrshkruhet, p\u00ebr shembull, n\u00eb postimin <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/company\/JetBrains\/blog\/342094\">\"Eksportimi i t\u00eb dh\u00ebnave nga Baza e t\u00eb Dh\u00ebnave n\u00eb \u00e7do format: \u00e7far\u00eb din\u00eb IDE-t\u00eb n\u00eb platform\u00ebn IntelliJ\"<\/a><\/noindex>).<\/p>\n<p><\/p>\n<h5 id=\"operacii-s-obektami\">Operacione me objekte<\/h5>\n<p><\/p>\n<p>Pas gjetjes dhe studimit t\u00eb objekteve t\u00eb nevojshme, \u00ebsht\u00eb koha q\u00eb t\u00eb b\u00ebjm\u00eb di\u00e7ka t\u00eb dobishme me ta. Natyrisht, pa i ndar\u00eb gishti nga tastiera.<\/p>\n<p><\/p>\n<p>Nuk \u00ebsht\u00eb nj\u00eb sekret se heqja e thjesht\u00eb e nj\u00eb tabele do t\u00eb duket e ngjashme n\u00eb pothuajse t\u00eb gjitha bazat e t\u00eb dh\u00ebnave:<\/p>\n<p><\/p>\n<pre><code class=\"sql\">hiq tabel\u00ebn hr.persons<\/code><\/pre>\n<p><\/p>\n<p>Krijimi i nj\u00eb tabele \u00ebsht\u00eb m\u00eb interesant. Practikisht \u00e7do SGBD (p\u00ebrfshir\u00eb shum\u00eb NoSQL) n\u00eb nj\u00eb m\u00ebnyr\u00eb ose n\u00eb nj\u00eb tjet\u00ebr di t\u00eb \"create table\", dhe pjesa kryesore e saj do t\u00eb jet\u00eb e ngjashme (emri, lista e kolonave, llojet e t\u00eb dh\u00ebnave), por detajet e tjera mund t\u00eb ndryshojn\u00eb ndjesh\u00ebm dhe varen nga struktura dhe mund\u00ebsit\u00eb specifike t\u00eb SGBD-s\u00eb. Shembulli im i preferuar \u2014 n\u00eb dokumentacionin Oracle jan\u00eb vet\u00ebm disa \"notacionitete\" p\u00ebr sintaks\u00ebn \"create table\". <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-database\/19\/sqlrf\/sql-language-reference.pdf\">z\u00eb 31 faqe<\/a><\/noindex>. DBMS t\u00eb tjera kan\u00eb mund\u00ebsi m\u00eb modeste, por \u00e7do nj\u00ebra prej tyre gjithashtu ka nj\u00eb s\u00ebr\u00eb ve\u00e7orish interesante dhe unikale p\u00ebr krijimin e tabelave (<noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/sql-createtable.html\">postgres<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/create-table.html\">mysql<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/www.cockroachlabs.com\/docs\/stable\/create-table.html#expanded\">cockroach<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.datastax.com\/en\/cql\/3.3\/cql\/cql_reference\/cqlCreateTable.html\">cassandra<\/a><\/noindex>). Nuk ka gjasa q\u00eb ndonj\u00eb \"wizard\" grafike nga ndonj\u00eb IDE (ve\u00e7an\u00ebrisht e p\u00ebrgjithshme) t\u00eb jet\u00eb n\u00eb gjendje t\u00eb mbuloj\u00eb plot\u00ebsisht t\u00eb gjitha k\u00ebto aft\u00ebsi, dhe edhe n\u00ebse e b\u00ebn, do t\u00eb jet\u00eb nj\u00eb spektak\u00ebl p\u00ebr ata q\u00eb nuk jan\u00eb t\u00eb fort\u00eb n\u00eb nerva. N\u00eb t\u00eb nj\u00ebjt\u00ebn koh\u00eb, nj\u00eb operator i shkruar si\u00e7 duhet dhe n\u00eb koh\u00ebn e duhur <strong><em>krijo tabel\u00eb<\/em><\/strong> do t\u00eb lejoj\u00eb t\u00eb shfryt\u00ebzoni leht\u00ebsisht t\u00eb gjitha ato, duke b\u00ebr\u00eb ruajtjen dhe qasjen n\u00eb t\u00eb dh\u00ebnat tuaja t\u00eb sigurta, optimale dhe maksimale t\u00eb k\u00ebndshme.<\/p>\n<p><\/p>\n<p>Po ashtu, n\u00eb shum\u00eb SGBD ka lloje specifike objektesh q\u00eb mungojn\u00eb n\u00eb SGBD t\u00eb tjera. Ne mund t\u00eb kryejm\u00eb operacione jo vet\u00ebm mbi objektet e DB, por edhe mbi vet\u00eb SGBD-n\u00eb, p\u00ebr shembull \"t\u00eb vrasim\" nj\u00eb proces, t\u00eb l\u00ebshojm\u00eb nj\u00eb zon\u00eb t\u00eb caktuar memorie, t\u00eb aktivizojm\u00eb gjurmimin, t\u00eb kalojm\u00eb n\u00eb modalitetin \"read only\" dhe shum\u00eb gj\u00ebra t\u00eb tjera.<\/p>\n<p><\/p>\n<h5 id=\"a-teper-nemnogo-porisuem\">Tani le t\u00eb pikturojm\u00eb pak<\/h5>\n<p><\/p>\n<p>Nj\u00eb nga detyrat m\u00eb t\u00eb zakonshme \u00ebsht\u00eb nd\u00ebrtimi i nj\u00eb diagrami me objekte t\u00eb DB, p\u00ebr t\u00eb par\u00eb objekte dhe lidhjet midis tyre n\u00eb nj\u00eb imazh t\u00eb bukur. Praktikisht \u00e7do IDE grafike, disa utilitar\u00eb t\u00eb komand\u00ebs dhe mjete speciale grafike e modeluesit mund t\u00eb b\u00ebjn\u00eb k\u00ebt\u00eb. Ato do t\u00eb vizatojn\u00eb di\u00e7ka \"si\u00e7 din\u00eb\", nd\u00ebrkoh\u00eb q\u00eb ndikimi n\u00eb k\u00ebt\u00eb proces mund t\u00eb kryhet vet\u00ebm p\u00ebrmes disa parametrave n\u00eb dosjen e konfigurimit ose opsioneve n\u00eb nd\u00ebrfaqe.<\/p>\n<p><\/p>\n<p>Por k\u00ebt\u00eb problem mund t\u00eb jet\u00eb shum\u00eb m\u00eb e thjesht\u00eb, m\u00eb fleksibile dhe elegante, natyrisht me ndihm\u00ebn e kodit. P\u00ebr nd\u00ebrtimin e diagram\u00ebve t\u00eb \u00e7do kompleksiteti, kemi disa gjuh\u00eb t\u00eb specializuara markup-u (DOT, GraphML etj), dhe p\u00ebr to \u2014 nj\u00eb mori aplikacionesh (GraphViz, PlantUML, Mermaid), t\u00eb cilat jan\u00eb n\u00eb gjendje t\u00eb lexojn\u00eb k\u00ebto udh\u00ebzime dhe t'i vizualizojn\u00eb n\u00eb formate t\u00eb ndryshme. Informacionin rreth objekteve dhe lidhjeve midis tyre tashm\u00eb e dim\u00eb si ta marrim.<\/p>\n<p><\/p>\n<p>Le t\u00eb japim nj\u00eb shembull t\u00eb vog\u00ebl se si do t\u00eb dukej kjo, duke p\u00ebrdorur PlantUML dhe <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/316428\/\">nj\u00eb baz\u00eb t\u00eb t\u00eb dh\u00ebnave demonstrative p\u00ebr PostgreSQL<\/a><\/noindex> (majta SQL-queri, i cili do t\u00eb gjeneroj\u00eb udh\u00ebzimin e nevojsh\u00ebm p\u00ebr PlantUML, dhe djathtas rezultati):<\/p>\n<p>\n<img decoding=\"async\" alt=\"Eksperienca \u00abDatabase as Code\u00bb\" src=\"\/wp-content\/uploads\/2020\/06\/c5cb2a138df1527abe47cbf8d695cb36.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<pre><code class=\"sql\">select '@startuml'||chr(10)||'hide methods'||chr(10)||'hide stereotypes' union all\nselect distinct ccu.table_name || ' --|&gt; ' ||\n       tc.table_name as val\n  from table_constraints as tc\n  join key_column_usage as kcu\n    on tc.constraint_name = kcu.constraint_name\n  join constraint_column_usage as ccu\n    on ccu.constraint_name = tc.constraint_name\n where tc.constraint_type = 'FOREIGN KEY'\n   and tc.table_name ~ '.*' union all\nselect '@enduml'<\/code><\/pre>\n<p><\/p>\n<p>Dhe n\u00ebse p\u00ebrpiqemi pak m\u00eb shum\u00eb, mbi <noindex><a rel=\"nofollow\" href=\"https:\/\/gist.github.com\/QuantumGhost\/0955a45383a0b6c0bc24f9654b3cb561\">ER-shabllonin p\u00ebr PlantUML<\/a><\/noindex> mund t\u00eb marrim di\u00e7ka shum\u00eb t\u00eb ngjashme me nj\u00eb diagram ER t\u00eb v\u00ebrtet\u00eb:<\/p>\n<p><\/p>\n<p>                        <b class=\"spoiler_title\">SQL-queri \u00ebsht\u00eb pak m\u00eb kompleks<\/b><\/p>\n<pre><code class=\"sql\">-- Kreu\nselect &#039;@startuml\n        !define Table(name,desc) class name as &quot;desc&quot; &lt;&lt; (T,#FFAAAA) &gt;&amp;gt;\n        !define primary_key(x) &lt;b&gt;x&lt;\/b&gt;\n        !define unique(x) &lt;color:green&gt;x&lt;\/color&gt;\n        !define not_null(x) &lt;u&gt;x&lt;\/u&gt;\n        hide methods\n        hide stereotypes&#039;\n union all\n-- Tabela\nselect format(&#039;Table(%s, &quot;%s n informacion rreth %s&quot;) {&#039;||chr(10), table_name, table_name, table_name) ||\n       (select string_agg(column_name || &#039; &#039; || upper(udt_name), chr(10))\n          from information_schema.columns\n         where table_schema = &#039;public&#039;\n           and table_name = t.table_name) || chr(10) || &#039;}&#039;\n  from information_schema.tables t\n where table_schema = &#039;public&#039;\n union all\n-- Marr&euml;dh&euml;niet midis tabelave\nselect distinct ccu.table_name || &#039; &quot;1&quot; --&amp;gt; &quot;0..N&quot; &#039; || tc.table_name || format(&#039; : &quot;Nj&euml; %s mund t&euml; ket&euml; shum&euml; %s&quot;&#039;, ccu.table_name, tc.table_name)\n  from information_schema.table_constraints as tc\n  join information_schema.key_column_usage as kcu on tc.constraint_name = kcu.constraint_name\n  join information_schema.constraint_column_usage as ccu on ccu.constraint_name = tc.constraint_name\n where tc.constraint_type = &#039;FOREIGN KEY&#039;\n   and ccu.constraint_schema = &#039;public&#039;\n   and tc.table_name ~ &#039;.*&#039;\n union all\n-- Fundi\nselect &#039;@enduml&#039;<\/code><\/pre>\n<p>\n<img decoding=\"async\" alt=\"Eksperienca \u00abDatabase as Code\u00bb\" src=\"\/wp-content\/uploads\/2020\/06\/bd45420a4fd1bdfcf20cbe74a0638c7b.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p>N\u00ebse e shikon me kujdes, shum\u00eb mjete vizualizuese n\u00eb thelb p\u00ebrdorin k\u00ebrkesa t\u00eb ngjashme. Megjithat\u00eb, k\u00ebto k\u00ebrkesa zakonisht jan\u00eb \"t\u00eb koduara\" n\u00eb vet\u00eb aplikacionin dhe jan\u00eb t\u00eb v\u00ebshtira p\u00ebr tu kuptuar <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/pgmodeler\/pgmodeler\/blob\/9c615c0b0871df3cd649983ce61e802b0ff0137b\/schemas\/catalog\/table.sch\">\"t\u00eb koduara\" n\u00eb kodin e vet\u00eb aplikacionit dhe jan\u00eb t\u00eb v\u00ebshtira p\u00ebr t'u kuptuar<\/a><\/noindex>Metrikat dhe monitorimi<\/p>\n<p><\/p>\n<h5 id=\"metriki-i-monitoring\">Metrit\u00eb dhe monitorimi<\/h5>\n<p><\/p>\n<p>Le t\u00ebrheqim v\u00ebmendjen tek nj\u00eb tem\u00eb tradicionalisht t\u00eb v\u00ebshtir\u00eb \u2014 monitorimi i performanc\u00ebs s\u00eb DB. Do t\u00eb ndaj nj\u00eb histori t\u00eb vog\u00ebl t\u00eb v\u00ebrtet\u00eb, t\u00eb treguar nga \"nj\u00eb mik im\". N\u00eb nj\u00eb projekt, jetonte nj\u00eb DBA i fuqish\u00ebm, dhe pak nga zhvilluesit ishin n\u00eb dijeni p\u00ebr t\u00eb, madje dhe kurr\u00eb nuk e kishin par\u00eb at\u00eb (ndon\u00ebse flitej se punonte diku n\u00eb nj\u00eb nd\u00ebrtes\u00eb p\u00ebrball\u00eb). N\u00eb or\u00ebn \"X\", kur sistemi prodhues i nj\u00eb shit\u00ebsi t\u00eb madh fillonte t\u00eb \"ndjehej keq\" s\u00ebrish, ai heshtur d\u00ebrgonte screenshot-e t\u00eb grafik\u00ebve nga Oracle Enterprise Manager, ku me kujdes theksonte vendet kritike me nj\u00eb marker t\u00eb kuq p\u00ebr \"p\u00ebrmir\u00ebsim\" (kjo, t\u00eb themi t\u00eb drejtat, ndihmonte pak). Dhe k\u00ebshtu, nga kjo \"fotokopje\", duhej t\u00eb b\u00ebhej diagnoza. Nd\u00ebrkoh\u00eb, askush nuk kishte qasje n\u00eb at\u00eb Enterprise Manager t\u00eb \u00e7muar (n\u00eb t\u00eb dy kuptimet e fjal\u00ebs), pasi sistemi \u00ebsht\u00eb kompleks dhe i shtrenjt\u00eb, ndoshta \"zhvilluesit do t\u00eb gjenin di\u00e7ka dhe do ta prishnin gjith\u00e7ka\". Prandaj, zhvilluesit gjenin vendin dhe shkakun e ngecjeve p\u00ebrmes nj\u00eb metode \"empirike\" dhe l\u00ebshonin nj\u00eb patch. N\u00ebse nj\u00eb let\u00ebr e frikshme nga DBA nuk vinte p\u00ebrs\u00ebri n\u00eb nj\u00eb afat t\u00eb shkurt\u00ebr, t\u00eb gjith\u00eb merrnin nj\u00eb frym\u00eb leht\u00ebsimi dhe ktheheshin tek detyrat e tyre aktuale (deri n\u00eb Let\u00ebrn e re).<\/p>\n<p><\/p>\n<p>Por ceshtjen e monitorimit, procesi mund t\u00eb duket m\u00eb arg\u00ebtues dhe miq\u00ebsor, dhe mbi t\u00eb gjitha - i qassh\u00ebm dhe transparent p\u00ebr t\u00eb gjith\u00eb. T\u00eb pakt\u00ebn pjesa e tij baz\u00eb, si nj\u00eb shtes\u00eb p\u00ebr sistemet kryesore t\u00eb monitorimit (t\u00eb cilat me siguri jan\u00eb t\u00eb dobishme e n\u00eb shum\u00eb raste t\u00eb domosdoshme). \u00c7do DBMS \u00ebsht\u00eb plot\u00ebsisht i gatsh\u00ebm dhe falas p\u00ebr t\u00eb ndar\u00eb informacion mbi gjendjen dhe performanc\u00ebn e tij aktuale. N\u00eb at\u00eb t\u00eb nj\u00ebjt\u00ebn Oracle DB \"t\u00eb mallkuar\", pothuajse \u00e7do informacion mbi performanc\u00ebn mund t\u00eb merret nga pamjet sistemore, duke filluar nga proceset dhe seancat dhe duke p\u00ebrfunduar me gjendjen e cache-it t\u00eb memory (p.sh., <noindex><a rel=\"nofollow\" href=\"https:\/\/oracle-base.com\/dba\/scripts\">Skriptet e DBA<\/a><\/noindex>, seksioni \"Monitoring\"). N\u00eb Postgresql gjithashtu ka nj\u00eb mori pamjesh sistemore p\u00ebr <noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/monitoring-stats.html\">monitorimin e pun\u00ebs s\u00eb DBMS<\/a><\/noindex>, ve\u00e7an\u00ebrisht ato q\u00eb jan\u00eb t\u00eb paz\u00ebvend\u00ebsueshme n\u00eb jet\u00ebn e p\u00ebrditshme t\u00eb \u00e7do DBA, si <noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW\">pg_stat_activity<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/monitoring-stats.html#PG-STAT-DATABASE-VIEW\">pg_stat_database<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/monitoring-stats.html#PG-STAT-BGWRITER-VIEW\">pg_stat_bgwriter<\/a><\/noindex>. N\u00eb MySQL p\u00ebr k\u00ebt\u00eb \u00ebsht\u00eb parashikuar madje nj\u00eb skem\u00eb e ve\u00e7ant\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/performance-schema-table-descriptions.html\">performance_schema<\/a><\/noindex>. Nd\u00ebrsa n\u00eb Mongo, nj\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.mongodb.com\/manual\/tutorial\/manage-the-database-profiler\/\">profiler<\/a><\/noindex> grumbullon t\u00eb dh\u00ebnat e performanc\u00ebs n\u00eb nj\u00eb koleksion sistemik <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.mongodb.com\/manual\/tutorial\/manage-the-database-profiler\/#view-profiler-data\">system.profile<\/a><\/noindex>.<\/p>\n<p><\/p>\n<p>K\u00ebshtu, duke u armatosur me ndonj\u00eb mblldh\u00ebs metrike (Telegraf, Metricbeat, Collectd), i cili di t\u00eb realizoj\u00eb k\u00ebrkesa sql t\u00eb personalizuara, depoit\u00ebn e k\u00ebtyre metrikeve (InfluxDB, Elasticsearch, Timescaledb) dhe vizualizuesin (Grafana, Kibana), mund t\u00eb krijoni nj\u00eb sistem monitorimi t\u00eb leht\u00eb dhe fleksib\u00ebl, i cili do t\u00eb integrohet ngusht\u00eb me metrikat e tjera sistemike (q\u00eb merren, p\u00ebr shembull, nga serveri i aplikacioneve, nga OS etj.). Si\u00e7 \u00ebsht\u00eb b\u00ebr\u00eb n\u00eb pgwatch2, ku p\u00ebrdoret kombinimi InfluxDB + Grafana dhe nj\u00eb grup k\u00ebrkesash p\u00ebr pamjet sistemike, t\u00eb cilave gjithashtu mund t\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/cybertec-postgresql\/pgwatch2#adding-metrics\">shtoni k\u00ebrkesa t\u00eb personalizuara<\/a><\/noindex>.<\/p>\n<p><\/p>\n<h2 id=\"itogo\">N\u00eb p\u00ebrfundim<\/h2>\n<p><\/p>\n<p>Dhe ky \u00ebsht\u00eb vet\u00ebm nj\u00eb list\u00eb e af\u00ebrt e asaj q\u00eb mund t\u00eb b\u00ebni me baz\u00ebn ton\u00eb t\u00eb t\u00eb dh\u00ebnave p\u00ebrmes kodit SQL t\u00eb zakonsh\u00ebm. Jam i sigurt, mund t\u00eb gjeni shum\u00eb aplikime t\u00eb tjera, na shkruani n\u00eb komentet. Dhe p\u00ebr at\u00eb se si (dhe m\u00eb e r\u00ebnd\u00ebsishmja, pse) t\u00eb automatizoni gjith\u00e7ka k\u00ebt\u00eb dhe ta p\u00ebrfshini n\u00eb pipeline-in tuaj CI\/CD do t\u00eb flasim her\u00ebn tjet\u00ebr.<\/p>\n<p>Burimi: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/426833\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>SQL, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0449\u0435? \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c select, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438, \u0437\u0430\u0442\u0435\u043c from, \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432 where \u0438 \u0432\u0441\u0435 \u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443 \u043d\u0430\u0441 \u0432 \u043a\u0430\u0440\u043c\u0430\u043d\u0435, \u043f\u0440\u0438\u0447\u0435\u043c (\u043f\u043e\u0447\u0442\u0438) \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u0430\u044f \u0421\u0423\u0411\u0414 \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c (\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u0421\u0423\u0411\u0414 \u0432\u043e\u0432\u0441\u0435). \u0412 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":83650,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-83649","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"SQL, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0449\u0435? \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c select, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438, \u0437\u0430\u0442\u0435\u043c from, \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432 where \u0438 \u0432\u0441\u0435 \u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443 \u043d\u0430\u0441 \u0432 \u043a\u0430\u0440\u043c\u0430\u043d\u0435, \u043f\u0440\u0438\u0447\u0435\u043c (\u043f\u043e\u0447\u0442\u0438) \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u0430\u044f \u0421\u0423\u0411\u0414 \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c (\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u0421\u0423\u0411\u0414 \u0432\u043e\u0432\u0441\u0435). \u0412\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/database-as-sode-experience\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u00abDatabase as \u0421ode\u00bb Experience | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"SQL, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0449\u0435? \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c select, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438, \u0437\u0430\u0442\u0435\u043c from, \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432 where \u0438 \u0432\u0441\u0435 \u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443 \u043d\u0430\u0441 \u0432 \u043a\u0430\u0440\u043c\u0430\u043d\u0435, \u043f\u0440\u0438\u0447\u0435\u043c (\u043f\u043e\u0447\u0442\u0438) \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u0430\u044f \u0421\u0423\u0411\u0414 \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c (\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u0421\u0423\u0411\u0414 \u0432\u043e\u0432\u0441\u0435). \u0412\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/database-as-sode-experience\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-06-02T05:42:21+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-06-02T05:42:21+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47\u00abDatabase as Code\u00bb Experience | ProHoster","description":"SQL, \u00e7far\u00eb mund t\u00eb jet\u00eb m\u00eb e thjesht\u00eb? \u00c7do nj\u00eb prej nesh mund t\u00eb shkruaj\u00eb nj\u00eb k\u00ebrkes\u00eb t\u00eb thjesht\u00eb \u2014 shkruajm\u00eb select, rendisim kolonat e nevojshme, pastaj from, emrin e tabel\u00ebs, pak kushte n\u00eb where dhe kjo \u00ebsht\u00eb \u2014 t\u00eb dh\u00ebnat e dobishme i kemi n\u00eb xhep, p\u00ebr m\u00eb tep\u00ebr (gati) pa marr\u00eb parasysh se cila DBMS ndodhet n\u00eb prapavij\u00eb (ndoshta as nuk \u00ebsht\u00eb nj\u00eb DBMS). N\u00eb","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/database-as-sode-experience","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u00abDatabase as \u0421ode\u00bb Experience | ProHoster","og:description":"SQL, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0449\u0435? \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c select, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438, \u0437\u0430\u0442\u0435\u043c from, \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432 where \u0438 \u0432\u0441\u0435 \u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443 \u043d\u0430\u0441 \u0432 \u043a\u0430\u0440\u043c\u0430\u043d\u0435, \u043f\u0440\u0438\u0447\u0435\u043c (\u043f\u043e\u0447\u0442\u0438) \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u0430\u044f \u0421\u0423\u0411\u0414 \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c (\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u0421\u0423\u0411\u0414 \u0432\u043e\u0432\u0441\u0435). \u0412","og:url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/database-as-sode-experience","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-06-02T05:42:21+00:00","article:modified_time":"2020-06-02T05:42:21+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"83649","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 15:13:28","updated":"2022-10-02 10:23:46"},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/83649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=83649"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/83649\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media\/83650"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=83649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=83649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=83649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}