Skip to content

Latest commit

 

History

History
1738 lines (1695 loc) · 67.9 KB

Super MYSQL funtimes.md

File metadata and controls

1738 lines (1695 loc) · 67.9 KB

MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_NextPart_01D635B9.B6307820"

This document is a Single File Web Page, also known as a Web Archive file. If you are seeing this message, your browser or editor doesn't support Web Archive files. Please download a browser that supports Web Archive.

------=_NextPart_01D635B9.B6307820 Content-Location: file:///C:/208A4604/SuperMYSQLfuntimes.md.htm Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="windows-1252"

<style> </style>

Super MYSQL funtimes:

T= his is a very simple set of weird and fun mysql experime= nts. Well, more accurately, two mysql experiments.

T= he first is a series of very simple string constructors, allowing simple find, inser= t, update, and delete queries.

Specialized query chains<= o:p>

T= hey work through chaining like so:

F= ind(<table>, [<columns>]).condition(<column>, <symbol>, <value>).execute()

I= nsert(<table>).value(<column>, <value>).execute()

D= elete(<table>)(<column>, <symbol>, <value>).e= xecute()

U= pdate(<table>).value(<column>, <value>).condition(<column>, <symbol>, <value>).execute()

Y= ou can chain conditions and values indefinitely in the above examples.<= /span>

W= hen chaining conditions you can also add joiners (optionally)

Generalized query proxies=

This is one of the approaches I haven�t seen before, so = I gave it a shot.

This u= ses proxies to make SQL queries behave in a more �typescript� kinda way. So this is a lot more flexible in usage and application, it�s become my goto for easy queri= es.

Start by creating a query=

Var &l= t;name of query object> =3D new Query(<table>)=

then a= dd constraints and/or parameters. Parameters are used when inserting or updati= ng. Constraints are used in where statements by Updates, Deletions and Selectio= ns.

<na= me of query object>.parameter =3D {<column>: value}
<name of query object>.parameter.<column> =3D value.
<name of query object>.constraint =3D {<column>: value}
<name of query object>.constraint.<column> =3D value=

You can also upfront define your where statement if you find simple constraints lac= king

<qu= ery object>.WHERE(�where columnA = * columnB =3D value�)

Finall= y, once your constraints and/or parameters are set, you can run your query

Const = myFunRow =3D await queryObject.f= indOne()

Const = myFunTable =3D await queryObject= .find(columnA)

Await = queryObject.insert()

Await = queryObject.delete()

Await = queryObject.update()

Why I made this

Basically� intellisense. <= span class=3DGramE>I�ve found it frustrating to have to check my notes fo= r how my table is structured. Some kind of global inte= rface for all my tables is the easiest way to navigate them.

If you find this kinda thi= ng interesting and exciting you should also check out scr= atchdb/database by omgimalexis because it�s likely going to be = a much more advanced and robust version of this concept that is more javascript friendly than something by a C# programmer= :P

------=_NextPart_01D635B9.B6307820 Content-Location: file:///C:/208A4604/SuperMYSQLfuntimes.md_files/themedata.thmx Content-Transfer-Encoding: base64 Content-Type: application/vnd.ms-officetheme

UEsDBBQABgAIAAAAIQDp3g+//wAAABwCAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKyRy07DMBBF 90j8g+UtSpyyQAgl6YLHjseifMDImSQWydiyp1X790zSVEKoIBZsLNkz954743K9Hwe1w5icp0qv 8kIrJOsbR12l3zdP2a1WiYEaGDxhpQ+Y9Lq+vCg3h4BJiZpSpXvmcGdMsj2OkHIfkKTS+jgCyzV2 JoD9gA7NdVHcGOuJkTjjyUPX5QO2sB1YPe7l+Zgk4pC0uj82TqxKQwiDs8CS1Oyo+UbJFkIuyrkn 9S6kK4mhzVnCVPkZsOheZTXRNajeIPILjBLDsAyJX89nIBkt5r87nons29ZZbLzdjrKOfDZezE7B /xRg9T/oE9PMf1t/AgAA//8DAFBLAwQUAAYACAAAACEApdan58AAAAA2AQAACwAAAF9yZWxzLy5y ZWxzhI/PasMwDIfvhb2D0X1R0sMYJXYvpZBDL6N9AOEof2giG9sb69tPxwYKuwiEpO/3qT3+rov5 4ZTnIBaaqgbD4kM/y2jhdj2/f4LJhaSnJQhbeHCGo3vbtV+8UNGjPM0xG6VItjCVEg+I2U+8Uq5C ZNHJENJKRds0YiR/p5FxX9cfmJ4Z4DZM0/UWUtc3YK6PqMn/s8MwzJ5PwX+vLOVFBG43lExp5GKh qC/jU72QqGWq1B7Qtbj51v0BAAD//wMAUEsDBBQABgAIAAAAIQBreZYWgwAAAIoAAAAcAAAAdGhl bWUvdGhl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AATAAAAAAAAAAAAAAAAAAAAAABbQ29udGVu dF9UeXBlc10ueG1sUEsBAi0AFAAGAAgAAAAhAKXWp+fAAAAANgEAAAsAAAAAAAAAAAAAAAAAMAEA AF9yZWxzLy5yZWxzUEsBAi0AFAAGAAgAAAAhAGt5lhaDAAAAigAAABwAAAAAAAAAAAAAAAAAGQIA AHRoZW1lL3RoZW1lL3RoZW1lTWFuYWdlci54bWxQSwECLQAUAAYACAAAACEAtvRnmJMHAADJIAAA FgAAAAAAAAAAAAAAAADWAgAAdGhlbWUvdGhlbWUvdGhlbWUxLnhtbFBLAQItABQABgAIAAAAIQAN 0ZCftgAAABsBAAAnAAAAAAAAAAAAAAAAAJ0KAAB0aGVtZS90aGVtZS9fcmVscy90aGVtZU1hbmFn ZXIueG1sLnJlbHNQSwUGAAAAAAUABQBdAQAAmAsAAAAA

------=_NextPart_01D635B9.B6307820 Content-Location: file:///C:/208A4604/SuperMYSQLfuntimes.md_files/colorschememapping.xml Content-Transfer-Encoding: quoted-printable Content-Type: text/xml

<a:clrMap xmlns:a=3D"http://schemas.openxmlformats.org/drawingml/2006/main"= bg1=3D"lt1" tx1=3D"dk1" bg2=3D"lt2" tx2=3D"dk2" accent1=3D"accent1" accent= 2=3D"accent2" accent3=3D"accent3" accent4=3D"accent4" accent5=3D"accent5" a= ccent6=3D"accent6" hlink=3D"hlink" folHlink=3D"folHlink"/> ------=_NextPart_01D635B9.B6307820 Content-Location: file:///C:/208A4604/SuperMYSQLfuntimes.md_files/filelist.xml Content-Transfer-Encoding: quoted-printable Content-Type: text/xml; charset="utf-8"

<xml xmlns:o=3D"urn:schemas-microsoft-com:office:office"> <o:MainFile HRef=3D"../SuperMYSQLfuntimes.md.htm"/> <o:File HRef=3D"themedata.thmx"/> <o:File HRef=3D"colorschememapping.xml"/> <o:File HRef=3D"filelist.xml"/> ------=_NextPart_01D635B9.B6307820--