From 5c6091286a0be86b114fabaacbdd0c819a0c4338 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 13 Apr 2025 14:27:54 +0200 Subject: [PATCH] Updated --- .../.docusaurus/client-manifest.json | 90 +-- .../default/p/aw-sql-974.json | 2 +- .../site-docs-classes-alter-table-md-c8e.json | 2 +- .../site-docs-classes-awsql-md-d7a.json | 2 +- ...site-docs-classes-create-table-md-763.json | 2 +- .../site-docs-classes-instance-md-761.json | 2 +- .../site-docs-classes-structure-md-24d.json | 2 +- .../site-docs-classes-update-md-2ab.json | 2 +- .../default/site-docs-intro-md-0e3.json | 2 +- ...docs-typedefs-column-structure-md-3ee.json | 2 +- ...cs-typedefs-constraint-options-md-a69.json | 2 +- docs/docusaurus/build/404.html | 2 +- .../build/assets/js/24da6c76.00f1b2a5.js | 1 - .../build/assets/js/d7af1896.f2a88258.js | 1 - .../build/category/classes/index.html | 4 +- .../build/category/typedefs/index.html | 4 +- .../build/classes/alter-table/index.html | 29 +- .../docusaurus/build/classes/awsql/index.html | 53 +- .../build/classes/create-table/index.html | 22 +- .../build/classes/delete/index.html | 25 +- .../build/classes/insert/index.html | 16 +- .../build/classes/instance/index.html | 176 ++---- .../build/classes/select/index.html | 69 +-- .../build/classes/structure/index.html | 254 +------- .../build/classes/update/index.html | 29 +- docs/docusaurus/build/index.html | 41 +- .../typedefs/column-structure/index.html | 32 +- .../typedefs/constraint-options/index.html | 32 +- docs/docusaurus/docs/classes/alter-table.md | 31 +- docs/docusaurus/docs/classes/awsql.md | 75 ++- docs/docusaurus/docs/classes/create-table.md | 24 +- docs/docusaurus/docs/classes/delete.md | 37 +- docs/docusaurus/docs/classes/insert.md | 24 +- docs/docusaurus/docs/classes/instance.md | 324 ++-------- docs/docusaurus/docs/classes/select.md | 140 ++--- docs/docusaurus/docs/classes/structure.md | 581 ++---------------- docs/docusaurus/docs/classes/update.md | 34 +- docs/docusaurus/docs/intro.md | 42 +- .../docs/typedefs/column-structure.md | 32 +- .../docs/typedefs/constraint-options.md | 36 +- docs/docusaurus/docs/typedefs/okpacket.md | 44 +- index.js | 9 +- package.json | 16 +- 43 files changed, 713 insertions(+), 1636 deletions(-) delete mode 100644 docs/docusaurus/build/assets/js/24da6c76.00f1b2a5.js delete mode 100644 docs/docusaurus/build/assets/js/d7af1896.f2a88258.js diff --git a/docs/docusaurus/.docusaurus/client-manifest.json b/docs/docusaurus/.docusaurus/client-manifest.json index 7f1ada7..686ba47 100644 --- a/docs/docusaurus/.docusaurus/client-manifest.json +++ b/docs/docusaurus/.docusaurus/client-manifest.json @@ -125,9 +125,9 @@ "23": { "js": [ { - "file": "assets/js/d7af1896.f2a88258.js", - "hash": "8e044d38139c814a", - "publicPath": "/awSQL/assets/js/d7af1896.f2a88258.js" + "file": "assets/js/d7af1896.82e89304.js", + "hash": "ad1669fcf655ee54", + "publicPath": "/awSQL/assets/js/d7af1896.82e89304.js" } ] }, @@ -161,9 +161,9 @@ "53": { "js": [ { - "file": "assets/js/7e36430b.8960b934.js", - "hash": "47e891266c5d8aab", - "publicPath": "/awSQL/assets/js/7e36430b.8960b934.js" + "file": "assets/js/7e36430b.b354b9c9.js", + "hash": "718a83e1c5929ee1", + "publicPath": "/awSQL/assets/js/7e36430b.b354b9c9.js" } ] }, @@ -188,18 +188,18 @@ "129": { "js": [ { - "file": "assets/js/3ee20894.dd13f441.js", - "hash": "0d0aefff28794409", - "publicPath": "/awSQL/assets/js/3ee20894.dd13f441.js" + "file": "assets/js/3ee20894.1f6e2c20.js", + "hash": "0879b98420fb13b7", + "publicPath": "/awSQL/assets/js/3ee20894.1f6e2c20.js" } ] }, "162": { "js": [ { - "file": "assets/js/23e85390.2618872f.js", - "hash": "c24136d1e49b39f5", - "publicPath": "/awSQL/assets/js/23e85390.2618872f.js" + "file": "assets/js/23e85390.a0249aa2.js", + "hash": "7639c0d4b7f0342d", + "publicPath": "/awSQL/assets/js/23e85390.a0249aa2.js" } ] }, @@ -224,45 +224,45 @@ "269": { "js": [ { - "file": "assets/js/e2f8b94f.ade39698.js", - "hash": "06611cfa27181e77", - "publicPath": "/awSQL/assets/js/e2f8b94f.ade39698.js" + "file": "assets/js/e2f8b94f.e1eb5318.js", + "hash": "4d411fc486116b50", + "publicPath": "/awSQL/assets/js/e2f8b94f.e1eb5318.js" } ] }, "294": { "js": [ { - "file": "assets/js/24da6c76.00f1b2a5.js", - "hash": "eb0c867e8e897139", - "publicPath": "/awSQL/assets/js/24da6c76.00f1b2a5.js" + "file": "assets/js/24da6c76.159e5a29.js", + "hash": "f0d831d470e02e50", + "publicPath": "/awSQL/assets/js/24da6c76.159e5a29.js" } ] }, "344": { "js": [ { - "file": "assets/js/2ab12074.600c5927.js", - "hash": "3a84469be2454a6a", - "publicPath": "/awSQL/assets/js/2ab12074.600c5927.js" + "file": "assets/js/2ab12074.76390b1f.js", + "hash": "b225c75845ee909a", + "publicPath": "/awSQL/assets/js/2ab12074.76390b1f.js" } ] }, "354": { "js": [ { - "file": "assets/js/runtime~main.0c00e2e3.js", - "hash": "59d21cc22876cc4f", - "publicPath": "/awSQL/assets/js/runtime~main.0c00e2e3.js" + "file": "assets/js/runtime~main.4e405e56.js", + "hash": "c937470a9f515f5f", + "publicPath": "/awSQL/assets/js/runtime~main.4e405e56.js" } ] }, "388": { "js": [ { - "file": "assets/js/c8ec3168.b94e6135.js", - "hash": "d8c4e382c8959338", - "publicPath": "/awSQL/assets/js/c8ec3168.b94e6135.js" + "file": "assets/js/c8ec3168.0f7a63be.js", + "hash": "16bcf9cadcb1e217", + "publicPath": "/awSQL/assets/js/c8ec3168.0f7a63be.js" } ] }, @@ -278,9 +278,9 @@ "468": { "js": [ { - "file": "assets/js/7617dfbd.053daa6b.js", - "hash": "cc722a79e9b3e8c6", - "publicPath": "/awSQL/assets/js/7617dfbd.053daa6b.js" + "file": "assets/js/7617dfbd.263a6f48.js", + "hash": "03bb6f213164a1b1", + "publicPath": "/awSQL/assets/js/7617dfbd.263a6f48.js" } ] }, @@ -296,27 +296,27 @@ "550": { "js": [ { - "file": "assets/js/763f4ffe.337527a1.js", - "hash": "e3c2820da330129a", - "publicPath": "/awSQL/assets/js/763f4ffe.337527a1.js" + "file": "assets/js/763f4ffe.a8324a68.js", + "hash": "d823e39604de0641", + "publicPath": "/awSQL/assets/js/763f4ffe.a8324a68.js" } ] }, "579": { "js": [ { - "file": "assets/js/a6964e95.5827e567.js", - "hash": "0c3796f90d6e88c1", - "publicPath": "/awSQL/assets/js/a6964e95.5827e567.js" + "file": "assets/js/a6964e95.e1343f6c.js", + "hash": "6c5063e85acf3a59", + "publicPath": "/awSQL/assets/js/a6964e95.e1343f6c.js" } ] }, "582": { "js": [ { - "file": "assets/js/b5207823.d5f3dd71.js", - "hash": "2b044c0b1bfb4ab9", - "publicPath": "/awSQL/assets/js/b5207823.d5f3dd71.js" + "file": "assets/js/b5207823.cdd836e5.js", + "hash": "1549c4e7a13ddc9b", + "publicPath": "/awSQL/assets/js/b5207823.cdd836e5.js" } ] }, @@ -413,9 +413,9 @@ "960": { "js": [ { - "file": "assets/js/58de6db1.acbf3523.js", - "hash": "b61a717ddbead4b3", - "publicPath": "/awSQL/assets/js/58de6db1.acbf3523.js" + "file": "assets/js/58de6db1.99333c32.js", + "hash": "1beaa9115381c47e", + "publicPath": "/awSQL/assets/js/58de6db1.99333c32.js" } ] }, @@ -431,9 +431,9 @@ "976": { "js": [ { - "file": "assets/js/0e384e19.c65359e3.js", - "hash": "5e2203b0e107c819", - "publicPath": "/awSQL/assets/js/0e384e19.c65359e3.js" + "file": "assets/js/0e384e19.45d51a01.js", + "hash": "a76a38834ecc3bcf", + "publicPath": "/awSQL/assets/js/0e384e19.45d51a01.js" } ] } diff --git a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/p/aw-sql-974.json b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/p/aw-sql-974.json index 05a89f7..3fb4a11 100644 --- a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/p/aw-sql-974.json +++ b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/p/aw-sql-974.json @@ -1 +1 @@ -{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"defaultSidebar":[{"type":"link","label":"Introduction","href":"/awSQL/","docId":"intro","unlisted":false},{"type":"category","label":"Classes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"awSQL","href":"/awSQL/classes/awsql","docId":"classes/awsql","unlisted":false},{"type":"link","label":"Instance","href":"/awSQL/classes/instance","docId":"classes/instance","unlisted":false},{"type":"link","label":"Select","href":"/awSQL/classes/select","docId":"classes/select","unlisted":false},{"type":"link","label":"Insert","href":"/awSQL/classes/insert","docId":"classes/insert","unlisted":false},{"type":"link","label":"Delete","href":"/awSQL/classes/delete","docId":"classes/delete","unlisted":false},{"type":"link","label":"Update","href":"/awSQL/classes/update","docId":"classes/update","unlisted":false},{"type":"link","label":"Structure","href":"/awSQL/classes/structure","docId":"classes/structure","unlisted":false},{"type":"link","label":"CreateTable","href":"/awSQL/classes/create-table","docId":"classes/create-table","unlisted":false},{"type":"link","label":"AlterTable","href":"/awSQL/classes/alter-table","docId":"classes/alter-table","unlisted":false}],"href":"/awSQL/category/classes"},{"type":"category","label":"Typedefs","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"OkPacket","href":"/awSQL/typedefs/okpacket","docId":"typedefs/okpacket","unlisted":false},{"type":"link","label":"ColumnStructure","href":"/awSQL/typedefs/column-structure","docId":"typedefs/column-structure","unlisted":false},{"type":"link","label":"ConstraintOptions","href":"/awSQL/typedefs/constraint-options","docId":"typedefs/constraint-options","unlisted":false}],"href":"/awSQL/category/typedefs"},{"type":"category","label":"Example Database","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Table: Categories","href":"/awSQL/example-db/Categories","docId":"example-db/Categories","unlisted":false},{"type":"link","label":"Table: Customers","href":"/awSQL/example-db/Customers","docId":"example-db/Customers","unlisted":false},{"type":"link","label":"Table: Employees","href":"/awSQL/example-db/Employees","docId":"example-db/Employees","unlisted":false},{"type":"link","label":"Table: OrderDetails","href":"/awSQL/example-db/OrderDetails","docId":"example-db/OrderDetails","unlisted":false},{"type":"link","label":"Table: Orders","href":"/awSQL/example-db/Orders","docId":"example-db/Orders","unlisted":false},{"type":"link","label":"Table: Products","href":"/awSQL/example-db/Products","docId":"example-db/Products","unlisted":false},{"type":"link","label":"Table: Shippers","href":"/awSQL/example-db/Shippers","docId":"example-db/Shippers","unlisted":false},{"type":"link","label":"Table: Suppliers","href":"/awSQL/example-db/Suppliers","docId":"example-db/Suppliers","unlisted":false}],"href":"/awSQL/category/example-database"}]},"docs":{"classes/alter-table":{"id":"classes/alter-table","title":"AlterTable","description":"Alters a table.","sidebar":"defaultSidebar"},"classes/awsql":{"id":"classes/awsql","title":"awSQL","description":"This is the default exported module that holds all Instances and manages them.","sidebar":"defaultSidebar"},"classes/create-table":{"id":"classes/create-table","title":"CreateTable","description":"Creates a new table with defined structure.","sidebar":"defaultSidebar"},"classes/delete":{"id":"classes/delete","title":"Delete","description":"Performs a query to delete rows from a table.","sidebar":"defaultSidebar"},"classes/insert":{"id":"classes/insert","title":"Insert","description":"Performs a query to insert new data into a table.","sidebar":"defaultSidebar"},"classes/instance":{"id":"classes/instance","title":"Instance","description":"Holds connection data and is the gateway to performing queries.","sidebar":"defaultSidebar"},"classes/select":{"id":"classes/select","title":"Select","description":"Performs a query to retrieve data from a table.","sidebar":"defaultSidebar"},"classes/structure":{"id":"classes/structure","title":"Structure","description":"Defines a new Table structure.","sidebar":"defaultSidebar"},"classes/update":{"id":"classes/update","title":"Update","description":"Performs a query to update data in a table.","sidebar":"defaultSidebar"},"example-db/Categories":{"id":"example-db/Categories","title":"Table: Categories","description":"| CategoryID | CategoryName | Description |","sidebar":"defaultSidebar"},"example-db/Customers":{"id":"example-db/Customers","title":"Table: Customers","description":"| CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |","sidebar":"defaultSidebar"},"example-db/Employees":{"id":"example-db/Employees","title":"Table: Employees","description":"| EmployeeID | LastName | FirstName | BirthDate | Photo | Notes |","sidebar":"defaultSidebar"},"example-db/OrderDetails":{"id":"example-db/OrderDetails","title":"Table: OrderDetails","description":"| OrderDetailID | OrderID | ProductID | Quantity |","sidebar":"defaultSidebar"},"example-db/Orders":{"id":"example-db/Orders","title":"Table: Orders","description":"| OrderID | CustomerID | EmployeeID | OrderDate | ShipperID |","sidebar":"defaultSidebar"},"example-db/Products":{"id":"example-db/Products","title":"Table: Products","description":"| ProductID | ProductName | SupplierID | CategoryID | Unit | Price |","sidebar":"defaultSidebar"},"example-db/Shippers":{"id":"example-db/Shippers","title":"Table: Shippers","description":"| ShipperID | ShipperName | Phone |","sidebar":"defaultSidebar"},"example-db/Suppliers":{"id":"example-db/Suppliers","title":"Table: Suppliers","description":"| SupplierID | SupplierName | ContactName | Address | City | PostalCode | Country | Phone |","sidebar":"defaultSidebar"},"intro":{"id":"intro","title":"Introduction","description":"This documentation is still in development.","sidebar":"defaultSidebar"},"typedefs/column-structure":{"id":"typedefs/column-structure","title":"ColumnStructure","description":"Object","sidebar":"defaultSidebar"},"typedefs/constraint-options":{"id":"typedefs/constraint-options","title":"ConstraintOptions","description":"Object","sidebar":"defaultSidebar"},"typedefs/okpacket":{"id":"typedefs/okpacket","title":"OkPacket","description":"Object","sidebar":"defaultSidebar"}}}} \ No newline at end of file +{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"defaultSidebar":[{"type":"link","label":"Introduction","href":"/awSQL/","docId":"intro","unlisted":false},{"type":"category","label":"Classes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"awSQL","href":"/awSQL/classes/awsql","docId":"classes/awsql","unlisted":false},{"type":"link","label":"Instance","href":"/awSQL/classes/instance","docId":"classes/instance","unlisted":false},{"type":"link","label":"Select","href":"/awSQL/classes/select","docId":"classes/select","unlisted":false},{"type":"link","label":"Insert","href":"/awSQL/classes/insert","docId":"classes/insert","unlisted":false},{"type":"link","label":"Delete","href":"/awSQL/classes/delete","docId":"classes/delete","unlisted":false},{"type":"link","label":"Update","href":"/awSQL/classes/update","docId":"classes/update","unlisted":false},{"type":"link","label":"Structure","href":"/awSQL/classes/structure","docId":"classes/structure","unlisted":false},{"type":"link","label":"CreateTable","href":"/awSQL/classes/create-table","docId":"classes/create-table","unlisted":false},{"type":"link","label":"AlterTable","href":"/awSQL/classes/alter-table","docId":"classes/alter-table","unlisted":false}],"href":"/awSQL/category/classes"},{"type":"category","label":"Typedefs","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"OkPacket","href":"/awSQL/typedefs/okpacket","docId":"typedefs/okpacket","unlisted":false},{"type":"link","label":"ColumnStructure","href":"/awSQL/typedefs/column-structure","docId":"typedefs/column-structure","unlisted":false},{"type":"link","label":"ConstraintOptions","href":"/awSQL/typedefs/constraint-options","docId":"typedefs/constraint-options","unlisted":false}],"href":"/awSQL/category/typedefs"},{"type":"category","label":"Example Database","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Table: Categories","href":"/awSQL/example-db/Categories","docId":"example-db/Categories","unlisted":false},{"type":"link","label":"Table: Customers","href":"/awSQL/example-db/Customers","docId":"example-db/Customers","unlisted":false},{"type":"link","label":"Table: Employees","href":"/awSQL/example-db/Employees","docId":"example-db/Employees","unlisted":false},{"type":"link","label":"Table: OrderDetails","href":"/awSQL/example-db/OrderDetails","docId":"example-db/OrderDetails","unlisted":false},{"type":"link","label":"Table: Orders","href":"/awSQL/example-db/Orders","docId":"example-db/Orders","unlisted":false},{"type":"link","label":"Table: Products","href":"/awSQL/example-db/Products","docId":"example-db/Products","unlisted":false},{"type":"link","label":"Table: Shippers","href":"/awSQL/example-db/Shippers","docId":"example-db/Shippers","unlisted":false},{"type":"link","label":"Table: Suppliers","href":"/awSQL/example-db/Suppliers","docId":"example-db/Suppliers","unlisted":false}],"href":"/awSQL/category/example-database"}]},"docs":{"classes/alter-table":{"id":"classes/alter-table","title":"AlterTable","description":"Modifies an existing table by altering its structure.","sidebar":"defaultSidebar"},"classes/awsql":{"id":"classes/awsql","title":"awSQL","description":"The default exported module that holds and manages all database instances globally.","sidebar":"defaultSidebar"},"classes/create-table":{"id":"classes/create-table","title":"CreateTable","description":"Creates a new table with a defined structure.","sidebar":"defaultSidebar"},"classes/delete":{"id":"classes/delete","title":"Delete","description":"Performs a query to delete rows from a table.","sidebar":"defaultSidebar"},"classes/insert":{"id":"classes/insert","title":"Insert","description":"Performs a query to insert new data into a table.","sidebar":"defaultSidebar"},"classes/instance":{"id":"classes/instance","title":"Instance","description":"Handles connection data and serves as the gateway for performing queries.","sidebar":"defaultSidebar"},"classes/select":{"id":"classes/select","title":"Select","description":"Performs a query to retrieve data from a table.","sidebar":"defaultSidebar"},"classes/structure":{"id":"classes/structure","title":"Structure","description":"Defines a new table structure for managing columns efficiently.","sidebar":"defaultSidebar"},"classes/update":{"id":"classes/update","title":"Update","description":"Executes a query to update data in a table.","sidebar":"defaultSidebar"},"example-db/Categories":{"id":"example-db/Categories","title":"Table: Categories","description":"| CategoryID | CategoryName | Description |","sidebar":"defaultSidebar"},"example-db/Customers":{"id":"example-db/Customers","title":"Table: Customers","description":"| CustomerID | CustomerName | ContactName | Address | City | PostalCode | Country |","sidebar":"defaultSidebar"},"example-db/Employees":{"id":"example-db/Employees","title":"Table: Employees","description":"| EmployeeID | LastName | FirstName | BirthDate | Photo | Notes |","sidebar":"defaultSidebar"},"example-db/OrderDetails":{"id":"example-db/OrderDetails","title":"Table: OrderDetails","description":"| OrderDetailID | OrderID | ProductID | Quantity |","sidebar":"defaultSidebar"},"example-db/Orders":{"id":"example-db/Orders","title":"Table: Orders","description":"| OrderID | CustomerID | EmployeeID | OrderDate | ShipperID |","sidebar":"defaultSidebar"},"example-db/Products":{"id":"example-db/Products","title":"Table: Products","description":"| ProductID | ProductName | SupplierID | CategoryID | Unit | Price |","sidebar":"defaultSidebar"},"example-db/Shippers":{"id":"example-db/Shippers","title":"Table: Shippers","description":"| ShipperID | ShipperName | Phone |","sidebar":"defaultSidebar"},"example-db/Suppliers":{"id":"example-db/Suppliers","title":"Table: Suppliers","description":"| SupplierID | SupplierName | ContactName | Address | City | PostalCode | Country | Phone |","sidebar":"defaultSidebar"},"intro":{"id":"intro","title":"Introduction","description":"awSQL is a fast and reliable database query tool designed to:","sidebar":"defaultSidebar"},"typedefs/column-structure":{"id":"typedefs/column-structure","title":"ColumnStructure","description":"Type: Object","sidebar":"defaultSidebar"},"typedefs/constraint-options":{"id":"typedefs/constraint-options","title":"ConstraintOptions","description":"Type: Object","sidebar":"defaultSidebar"},"typedefs/okpacket":{"id":"typedefs/okpacket","title":"OkPacket","description":"Object","sidebar":"defaultSidebar"}}}} \ No newline at end of file diff --git a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-alter-table-md-c8e.json b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-alter-table-md-c8e.json index 5992b71..e6af2ef 100644 --- a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-alter-table-md-c8e.json +++ b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-alter-table-md-c8e.json @@ -1,7 +1,7 @@ { "id": "classes/alter-table", "title": "AlterTable", - "description": "Alters a table.", + "description": "Modifies an existing table by altering its structure.", "source": "@site/docs/classes/alter-table.md", "sourceDirName": "classes", "slug": "/classes/alter-table", diff --git a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-awsql-md-d7a.json b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-awsql-md-d7a.json index cc56ec4..537e854 100644 --- a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-awsql-md-d7a.json +++ b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-awsql-md-d7a.json @@ -1,7 +1,7 @@ { "id": "classes/awsql", "title": "awSQL", - "description": "This is the default exported module that holds all Instances and manages them.", + "description": "The default exported module that holds and manages all database instances globally.", "source": "@site/docs/classes/awsql.md", "sourceDirName": "classes", "slug": "/classes/awsql", diff --git a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-create-table-md-763.json b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-create-table-md-763.json index 95213da..feae952 100644 --- a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-create-table-md-763.json +++ b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-create-table-md-763.json @@ -1,7 +1,7 @@ { "id": "classes/create-table", "title": "CreateTable", - "description": "Creates a new table with defined structure.", + "description": "Creates a new table with a defined structure.", "source": "@site/docs/classes/create-table.md", "sourceDirName": "classes", "slug": "/classes/create-table", diff --git a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-instance-md-761.json b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-instance-md-761.json index e78f644..5ef69ab 100644 --- a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-instance-md-761.json +++ b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-instance-md-761.json @@ -1,7 +1,7 @@ { "id": "classes/instance", "title": "Instance", - "description": "Holds connection data and is the gateway to performing queries.", + "description": "Handles connection data and serves as the gateway for performing queries.", "source": "@site/docs/classes/instance.md", "sourceDirName": "classes", "slug": "/classes/instance", diff --git a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-structure-md-24d.json b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-structure-md-24d.json index 56df71d..4c71861 100644 --- a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-structure-md-24d.json +++ b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-structure-md-24d.json @@ -1,7 +1,7 @@ { "id": "classes/structure", "title": "Structure", - "description": "Defines a new Table structure.", + "description": "Defines a new table structure for managing columns efficiently.", "source": "@site/docs/classes/structure.md", "sourceDirName": "classes", "slug": "/classes/structure", diff --git a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-update-md-2ab.json b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-update-md-2ab.json index cf65e7c..e00d7f4 100644 --- a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-update-md-2ab.json +++ b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-classes-update-md-2ab.json @@ -1,7 +1,7 @@ { "id": "classes/update", "title": "Update", - "description": "Performs a query to update data in a table.", + "description": "Executes a query to update data in a table.", "source": "@site/docs/classes/update.md", "sourceDirName": "classes", "slug": "/classes/update", diff --git a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-intro-md-0e3.json b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-intro-md-0e3.json index ea0dc13..1e4f63b 100644 --- a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-intro-md-0e3.json +++ b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-intro-md-0e3.json @@ -1,7 +1,7 @@ { "id": "intro", "title": "Introduction", - "description": "This documentation is still in development.", + "description": "awSQL is a fast and reliable database query tool designed to:", "source": "@site/docs/intro.md", "sourceDirName": ".", "slug": "/", diff --git a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-typedefs-column-structure-md-3ee.json b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-typedefs-column-structure-md-3ee.json index d8927c7..68d2646 100644 --- a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-typedefs-column-structure-md-3ee.json +++ b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-typedefs-column-structure-md-3ee.json @@ -1,7 +1,7 @@ { "id": "typedefs/column-structure", "title": "ColumnStructure", - "description": "Object", + "description": "Type: Object", "source": "@site/docs/typedefs/column-structure.md", "sourceDirName": "typedefs", "slug": "/typedefs/column-structure", diff --git a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-typedefs-constraint-options-md-a69.json b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-typedefs-constraint-options-md-a69.json index 58431f5..3f265d9 100644 --- a/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-typedefs-constraint-options-md-a69.json +++ b/docs/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-typedefs-constraint-options-md-a69.json @@ -1,7 +1,7 @@ { "id": "typedefs/constraint-options", "title": "ConstraintOptions", - "description": "Object", + "description": "Type: Object", "source": "@site/docs/typedefs/constraint-options.md", "sourceDirName": "typedefs", "slug": "/typedefs/constraint-options", diff --git a/docs/docusaurus/build/404.html b/docs/docusaurus/build/404.html index b88d57f..c1f5e6c 100644 --- a/docs/docusaurus/build/404.html +++ b/docs/docusaurus/build/404.html @@ -4,7 +4,7 @@ awSQL Documentation - + diff --git a/docs/docusaurus/build/assets/js/24da6c76.00f1b2a5.js b/docs/docusaurus/build/assets/js/24da6c76.00f1b2a5.js deleted file mode 100644 index 20aed28..0000000 --- a/docs/docusaurus/build/assets/js/24da6c76.00f1b2a5.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocusaurus=self.webpackChunkdocusaurus||[]).push([[294],{6421:(n,s,e)=>{e.r(s),e.d(s,{assets:()=>h,contentTitle:()=>c,default:()=>x,frontMatter:()=>d,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"classes/structure","title":"Structure","description":"Defines a new Table structure.","source":"@site/docs/classes/structure.md","sourceDirName":"classes","slug":"/classes/structure","permalink":"/awSQL/classes/structure","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":7,"frontMatter":{"sidebar_position":7},"sidebar":"defaultSidebar","previous":{"title":"Update","permalink":"/awSQL/classes/update"},"next":{"title":"CreateTable","permalink":"/awSQL/classes/create-table"}}');var i=e(4848),t=e(8453);const d={sidebar_position:7},c="Structure",h={},l=[{value:"Methods",id:"methods",level:2},{value:"constructor()",id:"constructor",level:3},{value:"get()",id:"get",level:3},{value:"drop()",id:"drop",level:3},{value:"char()",id:"char",level:3},{value:"varchar()",id:"varchar",level:3},{value:"binary()",id:"binary",level:3},{value:"varbinary()",id:"varbinary",level:3},{value:"tinyblob()",id:"tinyblob",level:3},{value:"tinytext()",id:"tinytext",level:3},{value:"text()",id:"text",level:3},{value:"blob()",id:"blob",level:3},{value:"mediumtext()",id:"mediumtext",level:3},{value:"longtext()",id:"longtext",level:3},{value:"longblob()",id:"longblob",level:3},{value:"enum()",id:"enum",level:3},{value:"set()",id:"set",level:3},{value:"bit()",id:"bit",level:3},{value:"tinyint()",id:"tinyint",level:3},{value:"bool()",id:"bool",level:3},{value:"smallint()",id:"smallint",level:3},{value:"mediumint()",id:"mediumint",level:3},{value:"int()",id:"int",level:3},{value:"bigint()",id:"bigint",level:3},{value:"float()",id:"float",level:3},{value:"double()",id:"double",level:3},{value:"decimal()",id:"decimal",level:3},{value:"date()",id:"date",level:3},{value:"datetime()",id:"datetime",level:3},{value:"timestamp()",id:"timestamp",level:3},{value:"time()",id:"time",level:3},{value:"year()",id:"year",level:3}];function o(n){const s={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,t.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.header,{children:(0,i.jsx)(s.h1,{id:"structure",children:"Structure"})}),"\n",(0,i.jsx)(s.p,{children:"Defines a new Table structure."}),"\n",(0,i.jsx)(s.h2,{id:"methods",children:"Methods"}),"\n",(0,i.jsx)(s.h3,{id:"constructor",children:"constructor()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"tableDescription"}),"? = ",(0,i.jsx)(s.strong,{children:"Array"}),"<",(0,i.jsx)(s.a,{href:"../typedefs/column-structure",children:"ColumnStructure"}),">) \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsx)(s.tbody,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"tableDescription"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.strong,{children:"Array"}),"<",(0,i.jsx)(s.a,{href:"../typedefs/column-structure",children:"ColumnStructure"}),">"]}),(0,i.jsxs)(s.td,{children:["An array holding a list of column structure objects to define columns with.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"You can get a ",(0,i.jsx)(s.code,{children:"tableDescription"})," from a structure with the ",(0,i.jsx)(s.a,{href:"#get",children:"get()"})," method, store it and load it again by creating a ",(0,i.jsx)(s.a,{href:"#structure",children:"Structure"})," with it in this constructor."]})]})})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"get",children:"get()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 () \u2192 ",(0,i.jsx)(s.strong,{children:"Array"}),"<",(0,i.jsx)(s.a,{href:"../typedefs/column-structure",children:"ColumnStructure"}),">"]}),"\n",(0,i.jsxs)(s.p,{children:["Returns an array containing all defined columns in the ",(0,i.jsx)(s.a,{href:"../typedefs/column-structure",children:"ColumnStructure"})," object."]}),"\n",(0,i.jsxs)(s.p,{children:["With this you can save the structure and load it again by passing it to the ",(0,i.jsx)(s.a,{href:"#constructor",children:"constructor"})," of a new ",(0,i.jsx)(s.a,{href:"#structure",children:"Structure"}),"."]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.strong,{children:"Array"}),"<",(0,i.jsx)(s.a,{href:"../typedefs/column-structure",children:"ColumnStructure"}),">"]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"drop",children:"drop()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Drops (removes) a column from this structure."}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsx)(s.tbody,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"The column name to drop"})]})})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"char",children:"char()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'char' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of characters to store in this column. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 0",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 255",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 1"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"varchar",children:"varchar()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'varchar' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of characters to store in this column. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 0",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 255",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 1"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"binary",children:"binary()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'binary' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of data. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 1"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"varbinary",children:"varbinary()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'varbinary' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of data. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 0",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 1"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"tinyblob",children:"tinyblob()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'tinyblob' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"tinytext",children:"tinytext()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'tinytext' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"text",children:"text()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'text' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"blob",children:"blob()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'blob' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of characters to store in this column. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 0",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 65535",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 65535"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"mediumtext",children:"mediumtext()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'mediumtext' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"longtext",children:"longtext()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'longtext' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"longblob",children:"longblob()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'longblob' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"enum",children:"enum()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"vals"}),"? = ",(0,i.jsx)(s.strong,{children:"Array"}),"<",(0,i.jsx)(s.strong,{children:"String"}),">, ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'enum' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"vals"})}),(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.strong,{children:"Array"}),"<",(0,i.jsx)(s.strong,{children:"String"}),">"]}),(0,i.jsx)(s.td,{children:"Array of possible values for this column."})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"set",children:"set()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"vals"}),"? = ",(0,i.jsx)(s.strong,{children:"Array"}),"<",(0,i.jsx)(s.strong,{children:"String"}),">, ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'enum' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"vals"})}),(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.strong,{children:"Array"}),"<",(0,i.jsx)(s.strong,{children:"String"}),">"]}),(0,i.jsx)(s.td,{children:"Array of possible values for this column."})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"bit",children:"bit()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'bit' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of data. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 64",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 1"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"tinyint",children:"tinyint()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'tinyint' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of data. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 255",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 255"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"bool",children:"bool()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'bool' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"smallint",children:"smallint()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'smallint' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of data. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 255",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 255"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"mediumint",children:"mediumint()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'mediumint' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of data. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 255",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 255"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"int",children:"int()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'int' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of data. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 255",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 255"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"bigint",children:"bigint()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'bigint' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of data. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 255",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 255"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"float",children:"float()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"p"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'float' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"p"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Precision. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 53",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 25"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"double",children:"double()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"d"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"})," ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'double' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of data. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 16"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"d"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Double precision. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 8"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"decimal",children:"decimal()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"size"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"d"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"})," ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'decimal' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"size"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Maximum length of data. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 16"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"d"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Double precision. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 1",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 8"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"date",children:"date()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),",",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'date' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"datetime",children:"datetime()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"fsp"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'datetime' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"fsp"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Fractional second precision. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 0",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 6",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 0"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"timestamp",children:"timestamp()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"fsp"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'timestamp' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"fsp"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Fractional second precision. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 0",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 6",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 0"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"time",children:"time()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"fsp"}),"? = ",(0,i.jsx)(s.strong,{children:"Number"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'time' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"fsp"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Number"})}),(0,i.jsxs)(s.td,{children:["Fractional second precision. ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Min"}),": 0",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Max"}),": 6",(0,i.jsx)("br",{}),"- ",(0,i.jsx)(s.em,{children:"Default"}),": 0"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h3,{id:"year",children:"year()"}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 (",(0,i.jsx)(s.code,{children:"name"})," = ",(0,i.jsx)(s.strong,{children:"String"}),", ",(0,i.jsx)(s.code,{children:"options"}),"? = ",(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"}),") \u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.p,{children:"Adds a new column of data type 'year' to this structure"}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Parameter"}),(0,i.jsx)(s.th,{children:"Type"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"name"})}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"String"})}),(0,i.jsx)(s.td,{children:"Name of the column"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"options"})," ",(0,i.jsx)(s.strong,{children:"optional"})]}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.a,{href:"../typedefs/constraint-options",children:"ConstraintOptions"})}),(0,i.jsx)(s.td,{children:"Additional constraint options"})]})]})]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(s.p,{children:["\u2192 ",(0,i.jsx)(s.code,{children:"this"})]}),"\n",(0,i.jsx)(s.hr,{})]})}function x(n={}){const{wrapper:s}={...(0,t.R)(),...n.components};return s?(0,i.jsx)(s,{...n,children:(0,i.jsx)(o,{...n})}):o(n)}},8453:(n,s,e)=>{e.d(s,{R:()=>d,x:()=>c});var r=e(6540);const i={},t=r.createContext(i);function d(n){const s=r.useContext(t);return r.useMemo((function(){return"function"==typeof n?n(s):{...s,...n}}),[s,n])}function c(n){let s;return s=n.disableParentContext?"function"==typeof n.components?n.components(i):n.components||i:d(n.components),r.createElement(t.Provider,{value:s},n.children)}}}]); \ No newline at end of file diff --git a/docs/docusaurus/build/assets/js/d7af1896.f2a88258.js b/docs/docusaurus/build/assets/js/d7af1896.f2a88258.js deleted file mode 100644 index 930cccf..0000000 --- a/docs/docusaurus/build/assets/js/d7af1896.f2a88258.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocusaurus=self.webpackChunkdocusaurus||[]).push([[23],{6986:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>a,frontMatter:()=>d,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"classes/awsql","title":"awSQL","description":"This is the default exported module that holds all Instances and manages them.","source":"@site/docs/classes/awsql.md","sourceDirName":"classes","slug":"/classes/awsql","permalink":"/awSQL/classes/awsql","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Classes","permalink":"/awSQL/category/classes"},"next":{"title":"Instance","permalink":"/awSQL/classes/instance"}}');var i=s(4848),r=s(8453);const d={sidebar_position:1},c="awSQL",l={},h=[{value:"Methods",id:"methods",level:2},{value:"createInstance()",id:"createinstance",level:3},{value:"getInstance()",id:"getinstance",level:3},{value:"listInstances()",id:"listinstances",level:3},{value:"deleteInstance()",id:"deleteinstance",level:3}];function o(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"awsql",children:"awSQL"})}),"\n",(0,i.jsx)(n.p,{children:"This is the default exported module that holds all Instances and manages them."}),"\n",(0,i.jsx)(n.p,{children:"It does not provide any functionality on top of managing instances globally."}),"\n",(0,i.jsx)(n.h2,{id:"methods",children:"Methods"}),"\n",(0,i.jsx)(n.h3,{id:"createinstance",children:"createInstance()"}),"\n",(0,i.jsxs)(n.p,{children:["\u2192 (",(0,i.jsx)(n.code,{children:"hostname"})," = ",(0,i.jsx)(n.strong,{children:"String"}),", ",(0,i.jsx)(n.code,{children:"username"})," = ",(0,i.jsx)(n.strong,{children:"String"}),", ",(0,i.jsx)(n.code,{children:"password"})," = ",(0,i.jsx)(n.strong,{children:"String"}),", ",(0,i.jsx)(n.code,{children:"options"}),"? = {",(0,i.jsx)(n.code,{children:"charset"}),"?: ",(0,i.jsx)(n.strong,{children:"String"}),", ",(0,i.jsx)(n.code,{children:"defaultDatabase"}),"?: ",(0,i.jsx)(n.strong,{children:"String"}),", ",(0,i.jsx)(n.code,{children:"multipleStatements"}),"?: ",(0,i.jsx)(n.strong,{children:"Boolean"}),", ",(0,i.jsx)(n.code,{children:"insecureAuth"}),"?: ",(0,i.jsx)(n.strong,{children:"Boolean"}),", ",(0,i.jsx)(n.code,{children:"customIdentifier"}),"?: ",(0,i.jsx)(n.strong,{children:"String"}),", ",(0,i.jsx)(n.code,{children:"isDefault"}),"?: ",(0,i.jsx)(n.strong,{children:"Boolean"}),"}) \u2192 ",(0,i.jsx)(n.a,{href:"./instance",children:"Instance"})]}),"\n",(0,i.jsx)(n.p,{children:"Creates a new instance to connect to a database."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"hostname"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"String"})}),(0,i.jsx)(n.td,{children:"The hostname where the database is hosted"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"username"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"String"})}),(0,i.jsx)(n.td,{children:"Username to connect with"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"password"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"String"})}),(0,i.jsx)(n.td,{children:"Password"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"options"})," ",(0,i.jsx)(n.strong,{children:"optional"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Object"})}),(0,i.jsx)(n.td,{children:"Additional options"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\u2192 ",(0,i.jsx)(n.code,{children:"options.charset"})," ",(0,i.jsx)(n.strong,{children:"optional"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"String"})}),(0,i.jsx)(n.td,{children:"The charset to use"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\u2192 ",(0,i.jsx)(n.code,{children:"options.defaultDatabase"})," ",(0,i.jsx)(n.strong,{children:"optional"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"String"})}),(0,i.jsx)(n.td,{children:"The default database to select for queries"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\u2192 ",(0,i.jsx)(n.code,{children:"options.multipleStatements"})," ",(0,i.jsx)(n.strong,{children:"optional"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Boolean"})}),(0,i.jsxs)(n.td,{children:["Whether to allow multiple statements in a single query. Defaults to ",(0,i.jsx)(n.code,{children:"false"})]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\u2192 ",(0,i.jsx)(n.code,{children:"options.insecureAuth"})," ",(0,i.jsx)(n.strong,{children:"optional"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Boolean"})}),(0,i.jsxs)(n.td,{children:["Whether insecure authentication methods should be allowed. Defaults to ",(0,i.jsx)(n.code,{children:"false"})]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\u2192 ",(0,i.jsx)(n.code,{children:"options.customIdentifier"})," ",(0,i.jsx)(n.strong,{children:"optional"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"String"})}),(0,i.jsxs)(n.td,{children:["Sets a custom identifier for this instance. Instances can be fetched by ",(0,i.jsx)(n.a,{href:"#getInstance",children:"getInstance()"}),' with this identifier. If not set, the identifier will be "',(0,i.jsx)(n.code,{children:"username"}),"@",(0,i.jsx)(n.code,{children:"hostname"}),'" by default.']})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:["\u2192 ",(0,i.jsx)(n.code,{children:"options.isDefault"})," ",(0,i.jsx)(n.strong,{children:"optional"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Boolean"})}),(0,i.jsxs)(n.td,{children:["Whether this instance is returned by default via ",(0,i.jsx)(n.a,{href:"#getInstance",children:"getInstance()"})," if the given identifier is empty or not retrievable"]})]})]})]}),"\n",(0,i.jsxs)(n.admonition,{title:"Possible errors",type:"warning",children:[(0,i.jsx)(n.p,{children:"This might crash if either of these situations happen:"}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"password"})," is empty"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"username"})," is empty"]}),"\n",(0,i.jsxs)(n.li,{children:["An instance with the same ",(0,i.jsx)(n.code,{children:"identifier"})," already exists"]}),"\n"]})]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(n.p,{children:["\u2192 ",(0,i.jsx)(n.a,{href:"./instance",children:"Instance"})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h3,{id:"getinstance",children:"getInstance()"}),"\n",(0,i.jsxs)(n.p,{children:["\u2192 (",(0,i.jsx)(n.code,{children:"identifier"}),"? = ",(0,i.jsx)(n.strong,{children:"String"}),") \u2192 ",(0,i.jsx)(n.a,{href:"./instance",children:"Instance"})," / ",(0,i.jsx)(n.strong,{children:"undefined"})]}),"\n",(0,i.jsxs)(n.p,{children:["Returns an already defined instance with the given ",(0,i.jsx)(n.code,{children:"identifier"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["If a default instance was set it returns said instance if the ",(0,i.jsx)(n.code,{children:"identifier"})," is empty."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"identifier"})," ",(0,i.jsx)(n.strong,{children:"optional"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"String"})}),(0,i.jsxs)(n.td,{children:["The instance name to retrieve. Note: If not set with ",(0,i.jsx)(n.code,{children:"options.customIdentifier"}),' upon creation instances will be identified by "',(0,i.jsx)(n.code,{children:"username"}),"@",(0,i.jsx)(n.code,{children:"hostname"}),'".',(0,i.jsx)("br",{})," If not given it returns the defined default instance."]})]})})]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"./instance",children:"Instance"})," - Instance was found"]}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.strong,{children:"undefined"})}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h3,{id:"listinstances",children:"listInstances()"}),"\n",(0,i.jsxs)(n.p,{children:["\u2192 () \u2192 ",(0,i.jsx)(n.strong,{children:"Array"}),"<",(0,i.jsx)(n.strong,{children:"String"}),">"]}),"\n",(0,i.jsx)(n.p,{children:"Returns a list of defined instance identifiers"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(n.p,{children:["\u2192 ",(0,i.jsx)(n.strong,{children:"Array"}),"<",(0,i.jsx)(n.strong,{children:"String"}),">"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h3,{id:"deleteinstance",children:"deleteInstance()"}),"\n",(0,i.jsxs)(n.p,{children:["\u2192 (",(0,i.jsx)(n.code,{children:"identifier"})," = ",(0,i.jsx)(n.strong,{children:"String"}),") \u2192 ",(0,i.jsx)(n.strong,{children:"true"})]}),"\n",(0,i.jsx)(n.p,{children:"Deletes an instance and closes any open connection"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Parameters"})}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"identifier"})," ",(0,i.jsx)(n.strong,{children:"optional"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"String"})}),(0,i.jsxs)(n.td,{children:["The instance to delete. Note: If not set with ",(0,i.jsx)(n.code,{children:"options.customIdentifier"}),' upon creation instances will be identified by "',(0,i.jsx)(n.code,{children:"username"}),"@",(0,i.jsx)(n.code,{children:"hostname"}),'".']})]})})]}),"\n",(0,i.jsxs)(n.admonition,{title:"Possible crash",type:"warning",children:[(0,i.jsx)(n.p,{children:"This might crash if either of these situations happen:"}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"identifier"})," is empty","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["To delete the default instance you must provide the ",(0,i.jsx)(n.code,{children:"identifier"})," of the default instance."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"identifier"})," is not of type ",(0,i.jsx)(n.strong,{children:"String"})]}),"\n",(0,i.jsxs)(n.li,{children:["No instance with the given ",(0,i.jsx)(n.code,{children:"identifier"})," was found"]}),"\n"]})]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(n.p,{children:["\u2192 ",(0,i.jsx)(n.strong,{children:"true"})]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsx)(n.p,{children:"Always returns true, as it will throw if any error happens to be sure any deletion was intended and correctly called."})})]})}function a(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>d,x:()=>c});var t=s(6540);const i={},r=t.createContext(i);function d(e){const n=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:d(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/docs/docusaurus/build/category/classes/index.html b/docs/docusaurus/build/category/classes/index.html index c835b5b..d3ebb04 100644 --- a/docs/docusaurus/build/category/classes/index.html +++ b/docs/docusaurus/build/category/classes/index.html @@ -4,10 +4,10 @@ Classes | awSQL Documentation - + -
Skip to main content
+
Skip to main content
\ No newline at end of file diff --git a/docs/docusaurus/build/category/typedefs/index.html b/docs/docusaurus/build/category/typedefs/index.html index 9e1b316..1534c3a 100644 --- a/docs/docusaurus/build/category/typedefs/index.html +++ b/docs/docusaurus/build/category/typedefs/index.html @@ -4,10 +4,10 @@ Typedefs | awSQL Documentation - + -
Skip to main content
+
Skip to main content
\ No newline at end of file diff --git a/docs/docusaurus/build/classes/alter-table/index.html b/docs/docusaurus/build/classes/alter-table/index.html index 70a562e..75668a0 100644 --- a/docs/docusaurus/build/classes/alter-table/index.html +++ b/docs/docusaurus/build/classes/alter-table/index.html @@ -3,41 +3,44 @@ -AlterTable | awSQL Documentation - +AlterTable | awSQL Documentation +
Skip to main content

AlterTable

-

Alters a table.

+

Modifies an existing table by altering its structure.

+

Methods

+

selectDatabase()

→ (database = String) → this

-

Selects a different database for this query.

+

Switches to a different database for this query.

Parameters

-
ParameterTypeDescription
databaseStringName of the database to select
+
ParameterTypeDescription
databaseStringThe name of the database to select.

Returns

this


structure()

→ (structure = Structure) → this

-

The new desired structure for the table to get.

+

Defines the new table structure.

+

Behavrior

    -
  • Drops columns that are existing in the current table but not in the given structure
  • -
  • Adds columns that are missing in the current table
  • -
  • Modifies all other columns where at least one datatype is not matching
  • +
  • Drops columns that exist in the current table but not in the new structure.
  • +
  • Adds missing columns.
  • +
  • Modifies columns where datatypes differ.

Parameters

-
ParameterTypeDescription
structureStructureNew structure definition for the table
+
ParameterTypeDescription
structureStructureThe new structure definition.

Returns

this


execute()

async → () → Instance.checkStructure()

-
Possible crash

structure() must always be given.

-

Executes the prepared query.

+

Executes the prepared table alteration query.

+
Important

The structure() method must be called before executing, or the operation may fail.

Returns

-

Instance.checkStructure() - Checks the structure afterwards and returns the check result

+

Instance.checkStructure() - Performs a post-execution structure check and returns the result.


\ No newline at end of file diff --git a/docs/docusaurus/build/classes/awsql/index.html b/docs/docusaurus/build/classes/awsql/index.html index f6c8018..ff915d3 100644 --- a/docs/docusaurus/build/classes/awsql/index.html +++ b/docs/docusaurus/build/classes/awsql/index.html @@ -3,62 +3,63 @@ -awSQL | awSQL Documentation - +awSQL | awSQL Documentation +
Skip to main content

awSQL

-

This is the default exported module that holds all Instances and manages them.

-

It does not provide any functionality on top of managing instances globally.

+

The default exported module that holds and manages all database instances globally.

+

It does not provide any additional functionality beyond managing instances.

+

Methods

+

createInstance()

→ (hostname = String, username = String, password = String, options? = {charset?: String, defaultDatabase?: String, multipleStatements?: Boolean, insecureAuth?: Boolean, customIdentifier?: String, isDefault?: Boolean}) → Instance

-

Creates a new instance to connect to a database.

+

Creates a new database connection instance.

Parameters

-
ParameterTypeDescription
hostnameStringThe hostname where the database is hosted
usernameStringUsername to connect with
passwordStringPassword
options optionalObjectAdditional options
options.charset optionalStringThe charset to use
options.defaultDatabase optionalStringThe default database to select for queries
options.multipleStatements optionalBooleanWhether to allow multiple statements in a single query. Defaults to false
options.insecureAuth optionalBooleanWhether insecure authentication methods should be allowed. Defaults to false
options.customIdentifier optionalStringSets a custom identifier for this instance. Instances can be fetched by getInstance() with this identifier. If not set, the identifier will be "username@hostname" by default.
options.isDefault optionalBooleanWhether this instance is returned by default via getInstance() if the given identifier is empty or not retrievable
-
Possible errors

This might crash if either of these situations happen:

    -
  • password is empty
  • -
  • username is empty
  • -
  • An instance with the same identifier already exists
  • +
    ParameterTypeDescription
    hostnameStringThe database hostname.
    usernameStringThe username for authentication.
    passwordStringThe password for authentication.
    options optionalObjectAdditional settings for the instance.
    options.charset optionalStringThe character set to use.
    options.defaultDatabase optionalStringDefault database for queries.
    options.multipleStatements optionalBooleanAllow multiple SQL statements in a single query (default: false).
    options.insecureAuth optionalBooleanEnables insecure authentication methods (default: false).
    options.customIdentifier optionalStringCustom instance identifier. Defaults to username@hostname.
    options.isDefault optionalBooleanMarks this instance as the default when no identifier is provided in getInstance().
    +
    Possible errors

    This method may crash if:

      +
    • password or username is empty.
    • +
    • An instance with the same identifier already exists.

    Returns

    Instance


    getInstance()

    → (identifier? = String) → Instance / undefined

    -

    Returns an already defined instance with the given identifier.

    -

    If a default instance was set it returns said instance if the identifier is empty.

    +

    Retrieves an existing database instance by its identifier.

    +

    If no identifier is provided and a default instance exists, it returns the default instance.

    Parameters

    -
    ParameterTypeDescription
    identifier optionalStringThe instance name to retrieve. Note: If not set with options.customIdentifier upon creation instances will be identified by "username@hostname".
    If not given it returns the defined default instance.
    +
    ParameterTypeDescription
    identifier optionalStringThe name of the instance to retrieve. If no explicitly set with customIdentifier, instances are identified as username@hostname.

    Returns

      -
    • Instance - Instance was found
    • -
    • undefined
    • +
    • Instance - if found.
    • +
    • undefined - if no instance matches the identifier.

    listInstances()

    → () → Array<String>

    -

    Returns a list of defined instance identifiers

    +

    Returns a list of all defined instance identifiers.

    Returns

    -

    Array<String>

    +

    Array<String> - A list of instance identifiers.


    deleteInstance()

    → (identifier = String) → true

    -

    Deletes an instance and closes any open connection

    +

    Deletes an existing instance and closes its database connection.

    Parameters

    -
    ParameterTypeDescription
    identifier optionalStringThe instance to delete. Note: If not set with options.customIdentifier upon creation instances will be identified by "username@hostname".
    -
    Possible crash

    This might crash if either of these situations happen:

      -
    • identifier is empty +
      ParameterTypeDescription
      identifier optionalStringThe identifier of the instance to delete. If customIdentifier was not set, use username@hostname.
      +
      Possible Error

      This method may crash if:

        +
      • identifier is empty.
          -
        • To delete the default instance you must provide the identifier of the default instance.
        • +
        • To delete the default instance, provide its identifier.
      • -
      • identifier is not of type String
      • -
      • No instance with the given identifier was found
      • +
      • identifier is not a String.
      • +
      • No instance with the given identifier exists.

      Returns

      -

      true

      -
      info

      Always returns true, as it will throw if any error happens to be sure any deletion was intended and correctly called.

+

true - Awayls returns true. Errors will cause an exception instead.

+
\ No newline at end of file diff --git a/docs/docusaurus/build/classes/create-table/index.html b/docs/docusaurus/build/classes/create-table/index.html index 65f29a6..f45bb07 100644 --- a/docs/docusaurus/build/classes/create-table/index.html +++ b/docs/docusaurus/build/classes/create-table/index.html @@ -3,19 +3,21 @@ -CreateTable | awSQL Documentation - +CreateTable | awSQL Documentation +
Skip to main content

CreateTable

-

Creates a new table with defined structure.

+

Creates a new table with a defined structure.

+

Methods

+

selectDatabase()

→ (database = String) → this

-

Selects a different database for this query.

+

Selects a specific database for the query.

Parameters

-
ParameterTypeDescription
databaseStringName of the database to select
+
ParameterTypeDescription
databaseStringThe name of the database to select.

Returns

this


@@ -23,22 +25,22 @@

→ (name = String) → this

Sets the name of the new table.

Parameters

-
ParameterTypeDescription
nameStringName for the table
+
ParameterTypeDescription
nameStringThe name of the table.

Returns

this


structure()

→ (structure = Structure) → this

-

The desired structure for the table to get.

+

Defines the desired structure for the new table.

Parameters

-
ParameterTypeDescription
structureStructureStructure for the table.
+
ParameterTypeDescription
structureStructureThe structure of the table.

Returns

this


execute()

async → () → OkPacket

-
Possible crash

structure() must always be given.

-

Executes the prepared query.

+

Executes the query and creates the table.

+
Possible Crash

The structure() method must be called before execution.

Returns

OkPacket


diff --git a/docs/docusaurus/build/classes/delete/index.html b/docs/docusaurus/build/classes/delete/index.html index d0736d6..b562da7 100644 --- a/docs/docusaurus/build/classes/delete/index.html +++ b/docs/docusaurus/build/classes/delete/index.html @@ -4,43 +4,48 @@ Delete | awSQL Documentation - +
Skip to main content

Delete

Performs a query to delete rows from a table.

-
Possible crash

To prevent accidental deletion of all rows, this will throw an error on execute() if no where() was defined.

To enable the deletion of all rows use force().

+
Possible crash

To prevent accidental deletion of all rows, an error will be thrown on execute() if no where() clause is defined.

To explicitly allow deletion of all rows, use force().

+

Methods

+

selectDatabase()

→ (database = String) → this

-

Selects a different database for this query.

+

Sets the database for this query.

Parameters

-
ParameterTypeDescription
databaseStringName of the database to select
+
ParameterTypeDescription
databaseStringThe database name to select.

Returns

this


where()

→ (string = String, values = Array<any>) → this

-

Adds a where-clause to the query

+

Addsa WHERE clause to the delete query.

    -
  • Values should be set as ? in the string and given in left-to-right order via the 'values'-array to minimize the risk of sql-injection
  • -
  • If you are using joins, specify the table and column together: table.column
  • +
  • Use placeholders (?) in the condition string and provide values in the values array to prevent SQL injection.
  • +
  • If using joins, specify the table and column together: "table.column".

Parameters

-
ParameterTypeDescription
stringStringThe where-clause as a string with ? representing each values.
valuesArray<any>Array containing values replacing the ? in the string (from left to right)
+
ParameterTypeDescription
stringStringSQL WHERE condition with ? placeholders.
valuesArray<any>Values replacing ?, in left-to-right order.
+

Example Usage

+
.delete().where("id = ?", [5])

Returns

this


force()

→ () → this

-

Enables deletion of all rows.

+

Enables deletion of all rows, overriding the safeguard in execute().

+
Use with Caution

Calling execute() after force() will delete all rows in the table.

Returns

this


execute()

async → () → OkPacket

-

Executes the prepared query.

+

Executes the prepared DELETE query.

Returns

OkPacket


diff --git a/docs/docusaurus/build/classes/insert/index.html b/docs/docusaurus/build/classes/insert/index.html index ceac4a7..7e87230 100644 --- a/docs/docusaurus/build/classes/insert/index.html +++ b/docs/docusaurus/build/classes/insert/index.html @@ -4,32 +4,36 @@ Insert | awSQL Documentation - +
Skip to main content

Insert

Performs a query to insert new data into a table.

+

Methods

+

selectDatabase()

→ (database = String) → this

-

Selects a different database for this query.

+

Sets the database for this query.

Parameters

-
ParameterTypeDescription
databaseStringName of the database to select
+
ParameterTypeDescription
databaseStringName of the database to select.

Returns

this


data()

→ (objects = Array<Object>) → this

-

The data (rows) to insert.

+

Defines the data (rows) to insert.

Parameters

-
ParameterTypeDescription
objectsArray<Object>Array containing objects to insert, where the key represent the column-name. All objects must have the same key-structure!
+
ParameterTypeDescription
objectsArray<Object>Array of objects where keys represent column names. All objects must have the same structure.
+

Example Usage

+
.insert()
.data([
{ id: 1, name: "Alice", age: 25 },
{ id: 2, name: "Bob", age: 30 }
])

Returns

this


execute()

async → () → OkPacket

-

Executes the prepared query.

+

Executes the prepared INSERT query.

Returns

OkPacket


diff --git a/docs/docusaurus/build/classes/instance/index.html b/docs/docusaurus/build/classes/instance/index.html index cfd1185..1e69b8e 100644 --- a/docs/docusaurus/build/classes/instance/index.html +++ b/docs/docusaurus/build/classes/instance/index.html @@ -3,51 +3,53 @@ -Instance | awSQL Documentation - +Instance | awSQL Documentation +
Skip to main content

Instance

-

Holds connection data and is the gateway to performing queries.

-

Instances can be managed via the default export awSQL

+

Handles connection data and serves as the gateway for performing queries.

+

Instances can be managed globally via awSQL.

+

Methods

+

connect()

Promise → () → String

-

Connects the instance.

-
Possible crash

Throws an error whenever the connection fails with an error

+

Establishes a connection to the database.

+
Possible Errors

Throws an error if the connection fails.

Returns

-

String - A connection string in the following format: "Connected to host with user user"

+

String - Connection confirmation in the format: "Connected to host with user user"


destroy()

→ () → true

-

Destroys the connection

+

Destroys the connection and releases resources.

Returns

-

true

+

true - Always returns true unless an error occurs.


queryRaw()

async → (queryString = String, values? = Array<any>) → any

-

Performs a raw query with the given sql-string.

-

To prevent sql-injections use ? and push your values in order into the values array.

+

Executes a raw SQL query.

+
Security Tip

Use ? placeholders and pass values seperately to prevent SQL injection.

Parameters

-
ParameterTypeDescription
queryStringStringThe sql-query to perform
valuesArray<any>? in the query string will be replaced by this values in order
+
ParameterTypeDescription
queryStringStringSQL query to execute.
valuesArray<any>Values for placeholders (?), in left-to-right order.

Returns

-

any - Whatever the query returns

+

any - Query Result


getDatabases()

async → (excludeSchema? = Boolean) → Array<String>

-

Returns a list of database names the user has access to

+

Retrieves a list of databases accessible to the user.

Parameters

-
ParameterTypeDescription
excludeSchema optionBooleanWhether to exclude the default database 'information_schema'
+
ParameterTypeDescription
excludeSchema optionBooleanExcludes information_schema if true

Returns

-

Array<String>

+

Array<String> - List of database names.

Example

const databases = await instance.getDatabases();
console.log(databases); // ['awSQL_dev','information_schema']
Excluding default database 'information_schema'
const databasesWithoutSchema = await instance.getDatabases(true);
console.log(databasesWithoutSchema); // ['awSQL_dev']

selectDatabase()

→ (name = String) → this

-

Selects a default database for future queries

+

Sets a default database for future queries.

Parameters

ParameterTypeDescription
nameStringThe database to select

Returns

@@ -55,136 +57,30 @@

getTables()

→ (database? = String) → Array<String>

-

Returns a list of tables for the selected database

-
Possible crash

options.multipleStatemens must have been set to true at creation of this instance for this to work. If not this will throw an error.

-

Parameters

-
ParameterTypeDescription
database optionalStringDatabase to get tables of. Can be empty as long as a default database was set with 'selectDatabase'
+

Retrieves a list of tables in the selected database.

+
Possible Errors

Requires options.multipleStatements set to true at instance creation.

Returns

Array<String>

-

Example

-
const tables = await instance.getTables("awSQL_dev"); // Getting tables of database "awSQL_dev"
+

Example Usage

+
const tables = await instance.getTables("awSQL_dev");
console.log(tables);
Result
[
'Categories',
'Customers',
'Employees',
'OrderDetails',
'Orders',
'Products',
'Shippers',
'Suppliers'
]

-

select()

-

→ (from = String, ...columns? = String) → Select

-

Prepares a new select query.

-

Parameters

-
ParameterTypeDescription
fromStringName of the table to select from
...columns optionalStringNames of the columns to include in the query. Leave empty to select all (*)
-

Returns

-

Select

+

Query Builders

+

These methods return specialized query objects that allow for structured queries:

+
MethodDescriptionReturns
.select(from, ...columns?)Prepare a SELECT query.Select
.insert(into)Prepare an INSERT query.Insert
.delete(from)Prepare a DELETE query.Delete
.update(table)Prepare an UPDATE query.Update

-

insert()

-

→ (into = String) → Insert

-

Prepares a new query to insert data.

-

Parameters

-
ParameterTypeDescription
intoStringName of the table to insert into
-

Returns

-

Insert

-
-

delete()

-

→ (from = String) → Delete

-

Prepares a new query to delete data.

-

Parameters

-
ParameterTypeDescription
fromStringName of the table to delete from
-

Returns

-

Delete

-
-

update()

-

→ (table = String) → Update

-

Prepares a new query to update data.

-

Parameters

-
ParameterTypeDescription
tableStringName of the table to update data of
-

Returns

-

Update

-
-

dropDatabase()

-

async → (database = String) → OkPacket

-

Drops a whole database

-
    -
  • Requires admin privileges
  • -
-

Parameters

-
ParameterTypeDescription
databaseStringThe name of the database to drop
-

Returns

-

OkPacket

-
-

dropTable()

-

async → (table = String) → OkPacket

-

Drops a whole table.

-
Possible crash

A default database must be set with selectDatabase()

-

Parameters

-
ParameterTypeDescription
tableStringThe name of the table to drop
-

Returns

-

OkPacket

-
-

createDatabase()

-

async → (name = String) → OkPacket

-

Creates a new database.

-
Possible crash
    -
  • Requires admin privileges, crashes otherwise
  • -
  • Crashes if the database already exists
  • +

    Database & Table Management

    +
    MethodDescriptionReturns
    .dropDatabase(database)Deletes an entire database (requires admin privileges).OkPacket
    .dropTable(table)Deletes a table (default database must be set).OkPacket
    .createDatabase(name)Creates a new database (fails if it already exists).OkPacket
    .createTable(name)Prepares a new table creation query.CreateTable
    .alterTable(name)Prepares a table modification query.AlterTable
    +
    Potential Errors
      +
    • Creating a database requires admin privileges.
    • +
    • Dropping a table reqeuires a default database to be selected.
    -

    Parameters

    -
    ParameterTypeDescription
    nameStringThe name of the database to create
    -

    Returns

    -

    OkPacket


    -

    createTable()

    -

    → (name = String) → CreateTable

    -

    Prepares to create a new table.

    -
    Possible crash

    Crashes if the table already exists

    -

    Parameters

    -
    ParameterTypeDescription
    nameStringThe name of the table to create
    -

    Returns

    -

    CreateTable

    +

    Structure Management

    +
    MethodDescriptionReturns
    .createStructure()Creates a structure object.Structure
    .getStructure(table, database?)Retrieves the structure of a table.Structure
    .checkStructure(table, desiredStructure, database?)Compares a table's structure with the expected one.{ errors: [], passed: [] }
    ✅ If errors.length === 0, the structure is correct.

    -

    alterTable()

    -

    → (name = String) → AlterTable

    -

    Prepares to alter a table.

    -

    Parameters

    -
    ParameterTypeDescription
    nameStringThe name of the table to alter
    -

    Returns

    -

    AlterTable

    -
    -

    createStructure()

    -

    → () → Structure

    -

    Creates a new structure.

    -

    Returns

    -

    Structure

    -
    -

    getStructure()

    -

    async → (table = String, database? = String) → Structure

    -

    Returns the structure object of a table.

    -

    Parameters

    -
    ParameterTypeDescription
    tableStringThe name of the table to get structure of
    database optionalStringName of the underlying database. Can be empty when a default database was set with selectDatabase()
    -

    Returns

    -

    Structure

    -
    -

    checkStructure()

    -

    async → (table = String, desiredStructure = Structure, database? = String) → Object

    -

    Checks the structure of a table against a given structure.

    -

    Parameters

    -
    ParameterTypeDescription
    tableStringThe name of the table to check
    desiredStructureStructureThe structure to check against
    database optionalStringName of the underlying database. Can be empty when a default database was set with selectDatabase()
    -

    Returns

    -

    Object

    -
    {
    errors: [<...String>], // Holds error messages
    passed: [<...String>] // Holds success messages
    }
    -
    info

    If errors.length is 0 the structure is correct

    -
    -

    total()

    -

    async → (table = String) → Number

    -

    Returns the total amount of rows of a table.

    -
      -
    • A default database must be set
    • -
    -

    Parameters

    -
    ParameterTypeDescription
    tableStringThe name of the table to check.
    -

    Returns

    -

    Number

    -
    -

    isConnected()

    -

    → () → Boolean

    -

    Returns whether the connection has been established.

    -

    Returns

    -

    Boolean

+

Utility Methods

+
MethodDescriptionReturns
.total(table)Counts total rows in a table. (Requires a default database).Number
.isConnected()Checks if the instance is connected.Boolean
+
\ No newline at end of file diff --git a/docs/docusaurus/build/classes/select/index.html b/docs/docusaurus/build/classes/select/index.html index bbf1d3e..e9d8c79 100644 --- a/docs/docusaurus/build/classes/select/index.html +++ b/docs/docusaurus/build/classes/select/index.html @@ -4,13 +4,15 @@ Select | awSQL Documentation - +
Skip to main content

Select

Performs a query to retrieve data from a table.

+

Methods

+

selectDatabase()

→ (database = String) → this

Selects a different database for this query.

@@ -21,59 +23,49 @@

distinct()

→ () → this

-

Adds the 'distinct' keyword to this query.

-
    -
  • With 'distinct' only unique values are returned
  • -
+

Ensures that only unique values are returned in the query results.

Returns

this

Example

Scenario: We want to get the EmployeeIDs of the Employees that have open orders in Orders

-
const empOrders = await instance.select("Orders", "EmployeeID") // Select table "Orders" and column "EmployeeID"
.distinct() // Only get unique EmployeeIDs
.execute();
console.log(empOrders);
/*
[
RowDataPacket { EmployeeID: 5 },
RowDataPacket { EmployeeID: 6 },
RowDataPacket { EmployeeID: 4 },
RowDataPacket { EmployeeID: 3 },
RowDataPacket { EmployeeID: 9 },
RowDataPacket { EmployeeID: 1 },
RowDataPacket { EmployeeID: 8 },
RowDataPacket { EmployeeID: 2 },
RowDataPacket { EmployeeID: 7 }
]
*/
+
const empOrders = await instance.select("Orders", "EmployeeID") // Selects "EmployeeID" from "Orders"
.distinct() // Ensures unique EmployeeIDs
.execute();
console.log(empOrders);
/* Output:
[
{ EmployeeID: 5 },
{ EmployeeID: 6 },
{ EmployeeID: 4 },
{ EmployeeID: 3 },
{ EmployeeID: 9 },
{ EmployeeID: 1 },
{ EmployeeID: 8 },
{ EmployeeID: 2 },
{ EmployeeID: 7 }
]
*/

where()

→ (string = String, values = Array<any>) → this

-

Adds a where-clause to the query

+

Adds a WHERE clause to filter results.

    -
  • Values should be set as ? in the string and given in left-to-right order via the 'values'-array to minimize the risk of sql-injection
  • -
  • If you are using joins, specify the table and column together: table.column
  • +
  • Use ? as placeholders in the condition string to prevent SQL injection.
  • +
  • If using joins, specify columns as table.column.

Parameters

-
ParameterTypeDescription
stringStringThe where-clause as a string with ? representing each values.
valuesArray<any>Array containing values replacing the ? in the string (from left to right)
+
ParameterTypeDescription
stringStringWHERE clause with ? placeholders for values.
valuesArray<any>Values to replace ?, in order.

Returns

this

Example

Scenario: We only want to get the Orders from the Customers with the id 90 and 34

-
const filteredOrders = await instance.select("Orders")  // Select table 'Orders'
// Filter by orders where CustomerID are our desired ids.
// Note that the values of ? are pushed in order into the value-array
.where("CustomerID = ? OR CustomerID = ?", [90, 34])
.execute();
console.log(filteredOrders);
/*
[
RowDataPacket {
OrderID: 10248,
CustomerID: 90,
EmployeeID: 5,
OrderDate: '1996-07-04',
ShipperID: 3
},
RowDataPacket {
OrderID: 10250,
CustomerID: 34,
EmployeeID: 4,
OrderDate: '1996-07-08',
ShipperID: 2
},
RowDataPacket {
OrderID: 10253,
CustomerID: 34,
EmployeeID: 3,
OrderDate: '1996-07-10',
ShipperID: 2
}
]
*/
+
const filteredOrders = await instance.select("Orders")  // Select "Orders" table
.where("CustomerID = ? OR CustomerID = ?", [90, 34])
.execute();
console.log(filteredOrders);
/* Output:
[
{ OrderID: 10248, CustomerID: 90, EmployeeID: 5, OrderDate: '1996-07-04', ShipperID: 3 },
{ OrderID: 10250, CustomerID: 34, EmployeeID: 4, OrderDate: '1996-07-08', ShipperID: 2 },
{ OrderID: 10253, CustomerID: 34, EmployeeID: 3, OrderDate: '1996-07-10', ShipperID: 2 }
]
*/

having()

→ (string = String, values = Array<any>) → this

-

Same as where() but allows for aggregation.

-
    -
  • Values should be set as ? in the string and given in left-to-right order via the 'values'-array to minimize the risk of sql-injection
  • -
  • If you are using joins, specify the table and column together: table.column
  • -
+

Same as .where(), but allows filtering after aggregation.

Parameters

-
ParameterTypeDescription
stringStringThe having-clause with possible aggregation ? representing each values.
valuesArray<any>Array containing values replacing the ? in the string (from left to right)
+
ParameterTypeDescription
stringStringHAVING clause with ? placeholders..
valuesArray<any>Values to replace ?, in order.

Returns

this


order()

→ (column = String, desc = Boolean, aggregation = Enum) → this

-

Adds a new sort order.

-
    -
  • Can be used multiple times to order by multiple columns
  • -
+

Adds sorting to the query.

Parameters

-
ParameterTypeDescription
columnStringColumn to order by
descBooleanSort descending? Defaults to false
aggregationEnumMIN/MAX/COUNT/SUM/AVGThe aggregation type to use
+
ParameterTypeDescription
columnStringColumn to order by.
descBooleanSort in descending order? Defaults to false.
aggregationEnumMIN/MAX/COUNT/SUM/AVGOptional aggregation function.

Returns

this


count()

→ (doParse = Boolean) → this

-

Counts the number of entries of the first selected column.

+

Counts the number of rows in the first selected column.

Parameters

-
ParameterTypeDescription
doParseBooleanIf true the query will only return a Number of entries. Defaults to false.
+
ParameterTypeDescription
doParseBooleanIf true, returns a number instead of an array. Defaults to false.

Returns

this


@@ -81,57 +73,56 @@

→ (doParse = Boolean) → this

Sums numerical rows of the first selected column.

Parameters

-
ParameterTypeDescription
doParseBooleanIf true the query will only return a Number of entries. Defaults to false.
+
ParameterTypeDescription
doParseBooleanIf true, returns a number. Defaults to false.

Returns

this


avg()

→ (doParse = Boolean) → this

-

Averages numerical rows of the first selected column.

+

Calculates the average value of numerical rows in the first selected column.

Parameters

-
ParameterTypeDescription
doParseBooleanIf true the query will only return a Number of entries. Defaults to false.
+
ParameterTypeDescription
doParseBooleanIf true, returns a number. Defaults to false.

Returns

this


group()

→ (...columns = String) → this

-

Groups rows that have the same values into summary rows.

+

Groups rows by the specified columns.

Parameters

-
ParameterTypeDescription
...columnsStringThe columns to group by
+
ParameterTypeDescription
...columnsStringColumns to group by.

Returns

this


join()

→ (type = Enum, table = String, onOriginalColumn = String, onJoinedColumn = String, ...columns = String) → this

-

Adds a new join to the query.

+

Performs a SQL JOIN.

Parameters

-
ParameterTypeDescription
typeEnumLEFT/INNER/RIGHT/FULL OUTERThe join type
tableStringTable to join on
onOriginalColumnStringColumn name on the original table to check agains
onJoinedColumnStringColumn name of the join table to check against
...columnsStringThe columns to join. OG-columns must be set!
+
ParameterTypeDescription
typeEnumLEFT/INNER/RIGHT/FULL OUTERType of join.
tableStringTable to join with.
onOriginalColumnStringColumn from the original table.
onJoinedColumnStringColumn from the joined table.
...columnsStringColumns to select.

Returns

this


limit()

→ (number = Number, offset = Number) → this

-

Limits the query and specifies an offset to start at.

-
warning

offset has no default value and therefore must not be empty!

+

Limits the number of returned rows and sets an offset.

Parameters

-
ParameterTypeDescription
numberNumberLimits the query by specified rows
offsetNumberOffset to start at.
+
ParameterTypeDescription
numberNumberMaximum rows to return.
offsetNumberOffset for starting position.

Returns

this


pagination()

→ (page = Number, itemsPerPage = Number) → this

-

Paginates the query.

+

Applies pagination to the query results.

Parameters

-
ParameterTypeDescription
pageNumberThe page to get (Minimum 1)
itemsPerPageNumberHow many items a page should have
+
ParameterTypeDescription
pageNumberThe page number (starting from 1).
itemsPerPageNumberNumber of items per page.

Returns

this


execute()

async → () → Number / Array<Object>

-

Executes the prepared query.

+

Executes the query.

Returns

-

Number - Numerical results
-→ Array<Object> - Row data

+

Number - if (doParse is true)
+→ Array<Object> - Query Result


\ No newline at end of file diff --git a/docs/docusaurus/build/classes/structure/index.html b/docs/docusaurus/build/classes/structure/index.html index e212689..699045e 100644 --- a/docs/docusaurus/build/classes/structure/index.html +++ b/docs/docusaurus/build/classes/structure/index.html @@ -3,259 +3,57 @@ -Structure | awSQL Documentation - +Structure | awSQL Documentation +
Skip to main content

Structure

-

Defines a new Table structure.

+

Defines a new table structure for managing columns efficiently.

+

Methods

+

constructor()

→ (tableDescription? = Array<ColumnStructure>) → this

+

Create a new Structure instance.

Parameters

-
ParameterTypeDescription
tableDescription optionalArray<ColumnStructure>An array holding a list of column structure objects to define columns with.

You can get a tableDescription from a structure with the get() method, store it and load it again by creating a Structure with it in this constructor.
+
ParameterTypeDescription
tableDescription optionalArray<ColumnStructure>A list of column structure objects defining table columns.

A table description can be retrieved using the get() method and later reloaded by passing it to the Structure constructor.

Returns

-

this

+

this - The instance of Structure.


get()

→ () → Array<ColumnStructure>

-

Returns an array containing all defined columns in the ColumnStructure object.

-

With this you can save the structure and load it again by passing it to the constructor of a new Structure.

+

Retrieves an array of all defined columns in the Structure as ColumnStructure objects.

Returns

-

Array<ColumnStructure>

+

Array<ColumnStructure> - A list of defined columns.


drop()

→ (name = String) → this

-

Drops (removes) a column from this structure.

+

Removes a column from the structure.

Parameters

-
ParameterTypeDescription
nameStringThe column name to drop
+
ParameterTypeDescription
nameStringThe column name to remove.

Returns

this


-

char()

-

→ (name = String, size? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'char' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of characters to store in this column.

- Min: 0
- Max: 255
- Default: 1
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

+

Column Methods

+

Each of these methods adds a column of the specified type to the structure.


-

varchar()

-

→ (name = String, size? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'varchar' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of characters to store in this column.

- Min: 0
- Max: 255
- Default: 1
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

+

String-Based Columns

+
MethodParametersDescription
char(name: String, size?: Number, options?: ConstraintOptions)size: (0-255, default 1)Adds a fixed-length character column.
varchar(name: String, size?: Number, options?: ConstraintOptions)size: (0-255, default 1)Adds a variable-length character column.
tinytext(name: String, options?: ConstraintOptions)-Adds a tinytext column.
text(name: String, options?: ConstraintOptions)-Adds a text column.
mediumtext(name: String, options?: ConstraintOptions)-Adds a mediumtext column.
longtext(name: String, options?: ConstraintOptions)-Adds a longtext column.

-

binary()

-

→ (name = String, size? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'binary' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of data.

- Min: 1
- Default: 1
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

+

Binary Data Columns

+
MethodParametersDescription
binary(name: String, size?: Number, options?: ConstraintOptions)size: (1+, default 1)Adds a binary column.
varbinary(name: String, size?: Number, options?: ConstraintOptions)size: (0+, default 1)Adds a variable-length binary column.
tinyblob(name: String, options?: ConstraintOptions)-Adds a tinyblob column.
blob(name: String, size?: Number, options?: ConstraintOptions)size: (0-65535, default 65535)Adds a blob column.
longblobl(name: String, options?: ConstraintOptions)-Adds a longblob column.

-

varbinary()

-

→ (name = String, size? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'varbinary' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of data.

- Min: 0
- Default: 1
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

+
MethodParametersDescription
enum(name: String, vals: Array<String>, options?: ConstraintOptions)vals: Array of allowed valuesAdds an enum column with predefined values.
set(name: String, vals: Array<String>, options?: ConstraintOptions)vals: Array of allowed valuesAdds a set column with multiple selectable values.

-

tinyblob()

-

→ (name = String, options? = ConstraintOptions) → this

-

Adds a new column of data type 'tinyblob' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

+

Numeric Columns

+
MethodParametersDescription
bit(name: String, size?: Number, options?: ConstraintOptions)size: (1-64, default 1)Adds a bit column.
tinyint(name: String, size?: Number, options?: ConstraintOptions)size: (1-255, default 255)Adds a tinyint column.
bool(name: String, options?: ConstraintOptions)-Alias for tinyint(1).
smallint(name: String, size?: Number, options?: ConstraintOptions)size: (1-255, default 255)Adds a smallint column.
mediumint(name: String, size?: Number, options?: ConstraintOptions)size: (1-255, default 255)Adds a mediumint column.
int(name: String, size?: Number, options?: ConstraintOptions)size: (1-255, default 255)Adds an int column.
bigint(name: String, size?: Number, options?: ConstraintOptions)size: (1-255, default 255)Adds a bigint column.

-

tinytext()

-

→ (name = String, options? = ConstraintOptions) → this

-

Adds a new column of data type 'tinytext' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

+

Floating Point & Decimal Columns

+
MethodParametersDescription
float(name: String, p?: Number, options?: ConstraintOptions)p: (1-53, default 25)Adds a float column.
double(name: String, size?: Number, d?: Number, options?: ConstraintOptions)size: (1+, default 16)
d: (1+, default 8)
Adds a double dolumn.
decimal(name: String, size?: Number, d?: Number, options?: ConstraintOptions)size: (1+, default 16)
d: (1+, default 8)
Adds a decimal column.

-

text()

-

→ (name = String, options? = ConstraintOptions) → this

-

Adds a new column of data type 'text' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

blob()

-

→ (name = String, size? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'blob' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of characters to store in this column.

- Min: 0
- Max: 65535
- Default: 65535
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

mediumtext()

-

→ (name = String, options? = ConstraintOptions) → this

-

Adds a new column of data type 'mediumtext' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

longtext()

-

→ (name = String, options? = ConstraintOptions) → this

-

Adds a new column of data type 'longtext' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

longblob()

-

→ (name = String, options? = ConstraintOptions) → this

-

Adds a new column of data type 'longblob' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

enum()

-

→ (name = String, vals? = Array<String>, options? = ConstraintOptions) → this

-

Adds a new column of data type 'enum' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
valsArray<String>Array of possible values for this column.
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

set()

-

→ (name = String, vals? = Array<String>, options? = ConstraintOptions) → this

-

Adds a new column of data type 'enum' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
valsArray<String>Array of possible values for this column.
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

bit()

-

→ (name = String, size? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'bit' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of data.

- Min: 1
- Max: 64
- Default: 1
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

tinyint()

-

→ (name = String, size? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'tinyint' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of data.

- Min: 1
- Max: 255
- Default: 255
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

bool()

-

→ (name = String, options? = ConstraintOptions) → this

-

Adds a new column of data type 'bool' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

smallint()

-

→ (name = String, size? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'smallint' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of data.

- Min: 1
- Max: 255
- Default: 255
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

mediumint()

-

→ (name = String, size? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'mediumint' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of data.

- Min: 1
- Max: 255
- Default: 255
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

int()

-

→ (name = String, size? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'int' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of data.

- Min: 1
- Max: 255
- Default: 255
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

bigint()

-

→ (name = String, size? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'bigint' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of data.

- Min: 1
- Max: 255
- Default: 255
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

float()

-

→ (name = String, p? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'float' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
p optionalNumberPrecision.

- Min: 1
- Max: 53
- Default: 25
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

double()

-

→ (name = String, size? = Number, d? = Number options? = ConstraintOptions) → this

-

Adds a new column of data type 'double' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of data.

- Min: 1
- Default: 16
d optionalNumberDouble precision.

- Min: 1
- Default: 8
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

decimal()

-

→ (name = String, size? = Number, d? = Number options? = ConstraintOptions) → this

-

Adds a new column of data type 'decimal' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
size optionalNumberMaximum length of data.

- Min: 1
- Default: 16
d optionalNumberDouble precision.

- Min: 1
- Default: 8
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

date()

-

→ (name = String,options? = ConstraintOptions) → this

-

Adds a new column of data type 'date' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

datetime()

-

→ (name = String, fsp? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'datetime' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
fsp optionalNumberFractional second precision.

- Min: 0
- Max: 6
- Default: 0
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

timestamp()

-

→ (name = String, fsp? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'timestamp' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
fsp optionalNumberFractional second precision.

- Min: 0
- Max: 6
- Default: 0
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

time()

-

→ (name = String, fsp? = Number, options? = ConstraintOptions) → this

-

Adds a new column of data type 'time' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
fsp optionalNumberFractional second precision.

- Min: 0
- Max: 6
- Default: 0
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
-

year()

-

→ (name = String, options? = ConstraintOptions) → this

-

Adds a new column of data type 'year' to this structure

-

Parameters

-
ParameterTypeDescription
nameStringName of the column
options optionalConstraintOptionsAdditional constraint options
-

Returns

-

this

-
+

Date & Time Columns

+
MethodParametersDescription
date(name: String, options?: ConstraintOptions)-Adds a date column.
datetime(name: String, fsp?: Number, options?: ConstraintOptions)fsp: (0-6, default 0)Adds a datetime column.
timestamp(name: String, fsp?: Number, options?: ConstraintOptions)fsp: (0-6, default 0)Adds a timestamp column.
time(name: String, fsp?: Number, options?: ConstraintOptions)fsp: (0-6, default 0)Adds a time column.
year(name: String, options?: ConstraintOptions)-Adds a year column.
+
\ No newline at end of file diff --git a/docs/docusaurus/build/classes/update/index.html b/docs/docusaurus/build/classes/update/index.html index 2ee55ef..6aa49ff 100644 --- a/docs/docusaurus/build/classes/update/index.html +++ b/docs/docusaurus/build/classes/update/index.html @@ -3,52 +3,53 @@ -Update | awSQL Documentation - +Update | awSQL Documentation +
Skip to main content

Update

-

Performs a query to update data in a table.

-
Possible crash

To prevent accidental update of all rows, this will throw an error on execute() if no where() was defined.

To enable the update of all rows use force().

+

Executes a query to update data in a table.

+
Possible Crash

To prevent accidental updates on all rows, this operation will throw an error when calling execute() if no where() clause is defined.

To explicitly allow updates on all rows, use force().

+

Methods

+

data()

→ (object = Object) → this

-

Updates all matching rows with the given object.

+

Updates all matching rows with the provided data.

Parameters

-
ParameterTypeDescription
objectObjectThe object with the data to update to. Keys represent column names.
+
ParameterTypeDescription
objectObjectAn object where keys represent column names and values represent the new data.

Returns

this


selectDatabase()

→ (database = String) → this

-

Selects a different database for this query.

+

Selects a different database for the query.

Parameters

-
ParameterTypeDescription
databaseStringName of the database to select
+
ParameterTypeDescription
databaseStringThe name of the database to use for the update.

Returns

this


force()

→ () → this

-

Enables update of all rows.

+

Allows updates on all rows in the table.

Returns

this


where()

→ (string = String, values = Array<any>) → this

-

Adds a where-clause to the query

+

Adds a WHERE clause to filter the update query.

    -
  • Values should be set as ? in the string and given in left-to-right order via the 'values'-array to minimize the risk of sql-injection
  • -
  • If you are using joins, specify the table and column together: table.column
  • +
  • Use ? as placeholders in the condition string to prevent SQL injection.

Parameters

-
ParameterTypeDescription
stringStringThe where-clause as a string with ? representing each values.
valuesArray<any>Array containing values replacing the ? in the string (from left to right)
+
ParameterTypeDescription
stringStringThe WHERE clause with ? placeholders.
valuesArray<any>An arrray of values replacing the placeholders in left-to-right order.

Returns

this


execute()

async → () → OkPacket

-

Executes the prepared query.

+

Executes the prepared update query.

Returns

OkPacket


diff --git a/docs/docusaurus/build/index.html b/docs/docusaurus/build/index.html index f9b31db..2f1be15 100644 --- a/docs/docusaurus/build/index.html +++ b/docs/docusaurus/build/index.html @@ -3,36 +3,35 @@ -Introduction | awSQL Documentation - +Introduction | awSQL Documentation +
Skip to main content

Introduction

-
Documentation not finished

This documentation is still in development.

Some examples might be missing.

-

awSQL is a fast and reliable database query tool.

-

It is designed to minimize the risk of sql-injections while maximizing usability and safety.

-

It prevents you from altering a whole set of rows by accident.

-

awSQL is designed to programmatically work with databases in an obvious manner. No more writing pesky and confusing sql-queries.

+

awSQL is a fast and reliable database query tool designed to:

+
    +
  • ✅ Minimize the risk of SQL injections
  • +
  • ✅ Maximize usability and safety
  • +
  • ✅ Prevent accidental bulk row modifications
  • +
+

With awSQL, you can programmatically interact with databases in a clear and intuitive manner - no more writing complex SQL queries manually!

Getting Started

-

To get started all you need is:

+

Requirements

+

To begin, ensure you have:

    -
  • An hosted database -
      -
    • Your credentials
    • -
    -
  • -
-

To install awSQL you can use npm:

-
npm i git+https://git.pwcca.eu/Sam/awSQL.git#release
-
    -
  • Please make sure to use the #release branch to not download the dev-version.
  • +
  • A hosted database
  • +
  • Your database credentials
+

Installation

+

Install awSQL via npm:

+
npm i git+https://git.pwcca.eu/Sam/awSQL.git#release
+
Important

Always use the #release branch to avoid downloading the development version.

Exports

-

awSQL exports 2 modules to use:

+

awSQL provides two core modules:

\ No newline at end of file diff --git a/docs/docusaurus/build/typedefs/column-structure/index.html b/docs/docusaurus/build/typedefs/column-structure/index.html index 5a34141..8cc0331 100644 --- a/docs/docusaurus/build/typedefs/column-structure/index.html +++ b/docs/docusaurus/build/typedefs/column-structure/index.html @@ -3,14 +3,14 @@ -ColumnStructure | awSQL Documentation - +ColumnStructure | awSQL Documentation +
Skip to main content

ColumnStructure

-

Object

-

This defines a single column object used by Structure.

+

Type: Object

+

Represents a single column object used by Structure.

Example structure

{
Field: "Column name",
Type: "Column type",
Null: "YES",
Key: "PRI",
Default: "Some default value",
Extra: ""
}

Properties

@@ -20,33 +20,25 @@

.Type

String

-

The column type.

+

The column type (e.g., VARCHAR(255), INT, TEXT).


.Null

EnumYES/NO

-

Whether the column allows null-values.

+

Specifies whether the column allows NULL values.


.Key

Enum /PRI/MUL/UNI

-

Key-Values for the table.

-
    -
  • (Empty) = None
  • -
  • PRI = Primary
  • -
  • MUL = Indexed
  • -
  • UNI = Unique
  • -
+

Defines the key type for the column.

+
ValueMeaning
"" (empty)No key
PRIPrimary key
MULIndexed (multiple rows can have the same value)
UNIUnique (all values must be distinct)

.Default

String / null

-

Default value for a new row.

+

THe default value for the column (if any).


.Extra

-

Enum /auto_increment

-

Extra values for the table.

-
    -
  • (Empty) = None
  • -
  • auto_increment = Primary key will be incremented on new data
  • -
+

Enum""/auto_increment

+

Additional attributes for the column.

+
ValueMeaning
"" (empty)No extra properties
auto_incrementThe column value auto-increments (typically for primary keys)

\ No newline at end of file diff --git a/docs/docusaurus/build/typedefs/constraint-options/index.html b/docs/docusaurus/build/typedefs/constraint-options/index.html index 08a4539..4936cc6 100644 --- a/docs/docusaurus/build/typedefs/constraint-options/index.html +++ b/docs/docusaurus/build/typedefs/constraint-options/index.html @@ -3,46 +3,52 @@ -ConstraintOptions | awSQL Documentation - +ConstraintOptions | awSQL Documentation +
Skip to main content

ConstraintOptions

-

Object

-

An object used to define additional constraints for a column within a Structure.

-
info

All keys within this object are optional.

You only need to define the keys for the settings you want to enable.

Default values are always false on Booleans or "" on Strings

+

Type: Object

+

Defines additional constraints for a column within a Structure.

+
info
    +
  • All keys in the object are optional
  • +
  • Only define the keys for the constraints you want to enable.
  • +
+

Example structure

{
"primary": true,
"index": true,
"null": true,
"unique": true,
"default": "Some default text",
"auto_increment": false,
"unsigned": true
}
+

Properties

+

.primary

Boolean

-

Whether this column should be the primary one.

+

Defines if this column should be the primary key.


.index

Boolean

-

Whether this column should be indexable (Faster query, slower insertion)

+

Marks the column as indexable (improves query speed but slows insertion).


.null

Boolean

-

Whether this column is null per default

+

Determines if the column allows NULL values by default.


.unique

Boolean

-

Whether this column data should be unique and block duplicate data.

+

Ensures that all values in this column are unique, preventing duplicates.


.default

String

-

Sets the default data for this column that gets inserted if no data was given on insertion.

+

The default value inserted when no value is providded.


.auto_increment

Boolean

-

Whether this column should be numerical incremented on new insertions.

+

Increments the column value automatically on new insertions (typically used for primary keys).


.unsigned

Boolean

-
Warning

This option is only valid on numerical columns.

-

Whether this column should be unsigned.

+

Defines whether the column should be unsigned (i.e., only allow non-negative numbers).

+
Warning

This option is only valid for numerical columns.


\ No newline at end of file diff --git a/docs/docusaurus/docs/classes/alter-table.md b/docs/docusaurus/docs/classes/alter-table.md index 7a54c0e..0169201 100644 --- a/docs/docusaurus/docs/classes/alter-table.md +++ b/docs/docusaurus/docs/classes/alter-table.md @@ -4,20 +4,24 @@ sidebar_position: 9 # AlterTable -Alters a table. +Modifies an existing table by altering its structure. + +--- ## Methods +--- + ### selectDatabase() → (`database` = __String__) → `this` -Selects a different database for this query. +Switches to a different database for this query. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `database` | __String__ | Name of the database to select | +| `database` | __String__ | The name of the database to select. | **Returns** @@ -28,17 +32,18 @@ Selects a different database for this query. ### structure() → (`structure` = [Structure](./structure)) → `this` -The new desired structure for the table to get. +Defines the new table structure. -- Drops columns that are existing in the current table but not in the given structure -- Adds columns that are missing in the current table -- Modifies all other columns where at least one datatype is not matching +**Behavrior** +- **Drops** columns that exist in the current table but not in the new structure. +- **Adds** missing columns. +- **Modifies** columns where datatypes differ. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `structure` | [Structure](./structure) | New structure definition for the table | +| `structure` | [Structure](./structure) | The new structure definition. | **Returns** @@ -49,14 +54,14 @@ The new desired structure for the table to get. ### execute() `async` → () → [Instance.checkStructure()](./instance#checkstructure) -:::warning Possible crash -[structure()](#structure) must always be given. -::: +Executes the prepared table alteration query. -Executes the prepared query. +:::warning Important +The [structure()](#structure) method **must** be called before executing, or the operation may fail. +::: **Returns** -→ [Instance.checkStructure()](./instance#checkstructure) - Checks the structure afterwards and returns the check result +→ [Instance.checkStructure()](./instance#checkstructure) - Performs a post-execution structure check and returns the result. *** \ No newline at end of file diff --git a/docs/docusaurus/docs/classes/awsql.md b/docs/docusaurus/docs/classes/awsql.md index 477fcdf..308354c 100644 --- a/docs/docusaurus/docs/classes/awsql.md +++ b/docs/docusaurus/docs/classes/awsql.md @@ -4,38 +4,40 @@ sidebar_position: 1 # awSQL -This is the default exported module that holds all Instances and manages them. +The default exported module that holds and manages all database instances globally. -It does not provide any functionality on top of managing instances globally. +It does not provide any additional functionality beyond managing instances. + +--- ## Methods +--- + ### createInstance() → (`hostname` = __String__, `username` = __String__, `password` = __String__, `options`? = \{`charset`?: __String__, `defaultDatabase`?: __String__, `multipleStatements`?: __Boolean__, `insecureAuth`?: __Boolean__, `customIdentifier`?: __String__, `isDefault`?: __Boolean__\}) → [Instance](./instance) -Creates a new instance to connect to a database. +Creates a new database connection instance. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `hostname` | __String__ | The hostname where the database is hosted | -| `username` | __String__ | Username to connect with | -| `password` | __String__ | Password | -| `options` __optional__ | __Object__ | Additional options | -| → `options.charset` __optional__ | __String__ | The charset to use | -| → `options.defaultDatabase` __optional__ | __String__ | The default database to select for queries | -| → `options.multipleStatements` __optional__ | __Boolean__ | Whether to allow multiple statements in a single query. Defaults to `false` | -| → `options.insecureAuth` __optional__ | __Boolean__ | Whether insecure authentication methods should be allowed. Defaults to `false` | -| → `options.customIdentifier` __optional__ | __String__ | Sets a custom identifier for this instance. Instances can be fetched by [getInstance()](#getInstance) with this identifier. If not set, the identifier will be "`username`@`hostname`" by default. | -| → `options.isDefault` __optional__ | __Boolean__ | Whether this instance is returned by default via [getInstance()](#getInstance) if the given identifier is empty or not retrievable | +| `hostname` | __String__ | The database hostname. | +| `username` | __String__ | The username for authentication. | +| `password` | __String__ | The password for authentication. | +| `options` __optional__ | __Object__ | Additional settings for the instance. | +| → `options.charset` __optional__ | __String__ | The character set to use. | +| → `options.defaultDatabase` __optional__ | __String__ | Default database for queries. | +| → `options.multipleStatements` __optional__ | __Boolean__ | Allow multiple SQL statements in a single query (default: `false`). | +| → `options.insecureAuth` __optional__ | __Boolean__ | Enables insecure authentication methods (default: `false`). | +| → `options.customIdentifier` __optional__ | __String__ | Custom instance identifier. Defaults to `username@hostname`. | +| → `options.isDefault` __optional__ | __Boolean__ | Marks this instance as the default when no identifier is provided in [getInstance()](#getinstance). | :::warning Possible errors -This might crash if either of these situations happen: - -- `password` is empty -- `username` is empty -- An instance with the same `identifier` already exists +This method **may crash** if: +- `password` or `username` is empty. +- An instance with the same `identifier` already exists. ::: **Returns** @@ -47,56 +49,53 @@ This might crash if either of these situations happen: ### getInstance() → (`identifier`? = __String__) → [Instance](./instance) / __undefined__ -Returns an already defined instance with the given `identifier`. +Retrieves an existing database instance by its `identifier`. -If a default instance was set it returns said instance if the `identifier` is empty. +If no identifier is provided and a default instance exists, it returns the default instance. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `identifier` __optional__ | __String__ | The instance name to retrieve. Note: If not set with `options.customIdentifier` upon creation instances will be identified by "`username`@`hostname`".
If not given it returns the defined default instance. | +| `identifier` __optional__ | __String__ | The name of the instance to retrieve. If no explicitly set with `customIdentifier`, instances are identified as `username@hostname`. | **Returns** -- [Instance](./instance) - Instance was found -- __undefined__ +- [Instance](./instance) - if found. +- __undefined__ - if no instance matches the identifier. *** ### listInstances() → () → __Array__\<__String__\> -Returns a list of defined instance identifiers +Returns a list of all defined instance identifiers. **Returns** -→ __Array__\<__String__\> +→ __Array__\<__String__\> - A list of instance identifiers. *** ### deleteInstance() → (`identifier` = __String__) → __true__ -Deletes an instance and closes any open connection +Deletes an existing instance and closes its database connection. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `identifier` __optional__ | __String__ | The instance to delete. Note: If not set with `options.customIdentifier` upon creation instances will be identified by "`username`@`hostname`". | +| `identifier` __optional__ | __String__ | The identifier of the instance to delete. If `customIdentifier` was not set, use `username@hostname`. | -:::warning Possible crash -This might crash if either of these situations happen: - -- `identifier` is empty - - To delete the default instance you must provide the `identifier` of the default instance. -- `identifier` is not of type __String__ -- No instance with the given `identifier` was found +:::warning Possible Error +This method **may crash** if: +- `identifier` is empty. + - To delete the default instance, provide its `identifier`. +- `identifier` is not a `String`. +- No instance with the given `identifier` exists. ::: **Returns** -→ __true__ +→ __true__ - Awayls returns `true`. Errors will cause an exception instead. -:::info -Always returns true, as it will throw if any error happens to be sure any deletion was intended and correctly called. -::: \ No newline at end of file +--- \ No newline at end of file diff --git a/docs/docusaurus/docs/classes/create-table.md b/docs/docusaurus/docs/classes/create-table.md index 4d3d439..ca6ed9a 100644 --- a/docs/docusaurus/docs/classes/create-table.md +++ b/docs/docusaurus/docs/classes/create-table.md @@ -4,20 +4,24 @@ sidebar_position: 8 # CreateTable -Creates a new table with defined structure. +Creates a new table with a defined structure. + +--- ## Methods +--- + ### selectDatabase() → (`database` = __String__) → `this` -Selects a different database for this query. +Selects a specific database for the query. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `database` | __String__ | Name of the database to select | +| `database` | __String__ | The name of the database to select. | **Returns** @@ -34,7 +38,7 @@ Sets the name of the new table. | Parameter | Type | Description | | -- | -- | -- | -| `name` | __String__ | Name for the table | +| `name` | __String__ | The name of the table. | **Returns** @@ -45,13 +49,13 @@ Sets the name of the new table. ### structure() → (`structure` = [Structure](./structure)) → `this` -The desired structure for the table to get. +Defines the desired structure for the new table. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `structure` | [Structure](./structure) | Structure for the table. | +| `structure` | [Structure](./structure) | The structure of the table. | **Returns** @@ -62,11 +66,11 @@ The desired structure for the table to get. ### execute() `async` → () → [OkPacket](../typedefs/okpacket) -:::warning Possible crash -[structure()](#structure) must always be given. -::: +Executes the query and creates the table. -Executes the prepared query. +:::warning Possible Crash +The [structure()](#structure) method **must** be called before execution. +::: **Returns** diff --git a/docs/docusaurus/docs/classes/delete.md b/docs/docusaurus/docs/classes/delete.md index 8ed89b5..543cea6 100644 --- a/docs/docusaurus/docs/classes/delete.md +++ b/docs/docusaurus/docs/classes/delete.md @@ -7,23 +7,27 @@ sidebar_position: 5 Performs a query to delete rows from a table. :::warning Possible crash -To prevent accidental deletion of all rows, this will throw an error on [execute()](#execute) if no [where()](#where) was defined. +To **prevent accidental deletion of all rows**, an error will be thrown on [execute()](#execute) if no [where()](#where) clause is defined. -To enable the deletion of all rows use [force()](#force). +To **explicitly allow deletion of all rows**, use [force()](#force). ::: +--- + ## Methods +--- + ### selectDatabase() → (`database` = __String__) → `this` -Selects a different database for this query. +Sets the database for this query. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `database` | __String__ | Name of the database to select | +| `database` | __String__ | The database name to select. | **Returns** @@ -34,17 +38,22 @@ Selects a different database for this query. ### where() → (`string` = __String__, `values` = __Array__\<__any__\>) → `this` -Adds a where-clause to the query - -- Values should be set as ? in the string and given in left-to-right order via the 'values'-array to minimize the risk of sql-injection -- If you are using joins, specify the table and column together: table.column +Addsa `WHERE` clause to the delete query. +- **Use placeholders (`?`)** in the condition string and provide values in the `values` array **to prevent SQL injection**. +- If using **joins**, specify the table and column together: `"table.column"`. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `string` | __String__ | The where-clause as a string with ? representing each values. | -| `values` | __Array__\<__any__\> | Array containing values replacing the ? in the string (from left to right) | +| `string` | __String__ | SQL `WHERE` condition with `?` placeholders. | +| `values` | __Array__\<__any__\> | Values replacing `?`, in left-to-right order. | + +**Example Usage** + +```js showLineNumbers +.delete().where("id = ?", [5]) +``` **Returns** @@ -55,7 +64,11 @@ Adds a where-clause to the query ### force() → () → `this` -Enables deletion of all rows. +**Enables deletion of all rows**, overriding the safeguard in [execute()](#execute). + +:::danger Use with Caution +Calling [execute()](#execute) after [force()](#force) will delete **all rows** in the table. +::: **Returns** @@ -66,7 +79,7 @@ Enables deletion of all rows. ### execute() `async` → () → [OkPacket](../typedefs/okpacket) -Executes the prepared query. +Executes the prepared `DELETE` query. **Returns** diff --git a/docs/docusaurus/docs/classes/insert.md b/docs/docusaurus/docs/classes/insert.md index 9910e94..04e36a6 100644 --- a/docs/docusaurus/docs/classes/insert.md +++ b/docs/docusaurus/docs/classes/insert.md @@ -6,18 +6,22 @@ sidebar_position: 4 Performs a query to insert new data into a table. +--- + ## Methods +--- + ### selectDatabase() → (`database` = __String__) → `this` -Selects a different database for this query. +Sets the database for this query. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `database` | __String__ | Name of the database to select | +| `database` | __String__ | Name of the database to select. | **Returns** @@ -28,13 +32,23 @@ Selects a different database for this query. ### data() → (`objects` = __Array__\<__Object__\>) → `this` -The data (rows) to insert. +Defines the data (rows) to insert. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `objects` | __Array__\<__Object__\> | Array containing objects to insert, where the key represent the column-name. All objects must have the same key-structure! | +| `objects` | __Array__\<__Object__\> | Array of objects where **keys represent column names**. All objects **must have the same structure**. | + +**Example Usage** +```js showLineNumbers +.insert() + .data([ + { id: 1, name: "Alice", age: 25 }, + { id: 2, name: "Bob", age: 30 } + ]) + +``` **Returns** @@ -45,7 +59,7 @@ The data (rows) to insert. ### execute() `async` → () → [OkPacket](../typedefs/okpacket) -Executes the prepared query. +Executes the prepared `INSERT` query. **Returns** diff --git a/docs/docusaurus/docs/classes/instance.md b/docs/docusaurus/docs/classes/instance.md index d1c429e..f5c4b01 100644 --- a/docs/docusaurus/docs/classes/instance.md +++ b/docs/docusaurus/docs/classes/instance.md @@ -4,70 +4,76 @@ sidebar_position: 2 # Instance -Holds connection data and is the gateway to performing queries. +Handles connection data and serves as the gateway for performing queries. -Instances can be managed via the default export [awSQL](./awsql) +Instances can be managed globally via [awSQL](../classes/awsql). + +--- ## Methods +--- + ### connect() `Promise` → () → __String__ -Connects the instance. +Establishes a connection to the database. -:::warning Possible crash -Throws an error whenever the connection fails with an error +:::warning Possible Errors +Throws an error if the connection fails. ::: **Returns** -→ __String__ - A connection string in the following format: "Connected to `host` with user `user`" +→ __String__ - Connection confirmation in the format: `"Connected to host with user user"` *** ### destroy() → () → __true__ -Destroys the connection +Destroys the connection and releases resources. **Returns** -→ __true__ +→ __true__ - Always returns `true` unless an error occurs. *** ### queryRaw() `async` → (`queryString` = __String__, `values`? = __Array__\<__any__\>) → __any__ -Performs a raw query with the given sql-string. +Executes a raw SQL query. -To prevent sql-injections use ? and push your values in order into the `values` array. +:::tip Security Tip +Use `?` placeholders and pass values seperately to prevent SQL injection. +::: **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `queryString` | __String__ | The sql-query to perform | -| `values` | __Array__\<__any__\> | ? in the query string will be replaced by this values in order | +| `queryString` | __String__ | SQL query to execute. | +| `values` | __Array__\<__any__\> | Values for placeholders (`?`), in left-to-right order. | **Returns** -→ __any__ - Whatever the query returns +→ __any__ - Query Result *** ### getDatabases() `async` → (`excludeSchema`? = __Boolean__) → __Array__\<__String__\> -Returns a list of database names the user has access to +Retrieves a list of databases accessible to the user. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `excludeSchema` __option__ | __Boolean__ | Whether to exclude the default database 'information_schema' | +| `excludeSchema` __option__ | __Boolean__ | Excludes `information_schema` if `true` | **Returns** -→ __Array__\<__String__\> +→ __Array__\<__String__\> - List of database names. **Example** @@ -86,7 +92,7 @@ console.log(databasesWithoutSchema); // ['awSQL_dev'] ### selectDatabase() → (`name` = __String__) → `this` -Selects a default database for future queries +Sets a default database for future queries. **Parameters** | Parameter | Type | Description | @@ -102,25 +108,21 @@ Selects a default database for future queries ### getTables() → (`database`? = __String__) → __Array__\<__String__\> -Returns a list of tables for the selected database +Retrieves a list of tables in the selected database. -:::warning Possible crash -`options.multipleStatemens` must have been set to __true__ at creation of this instance for this to work. If not this will throw an error. +:::warning Possible Errors +Requires `options.multipleStatements` set to `true` at instance creation. ::: -**Parameters** -| Parameter | Type | Description | -| -- | -- | -- | -| `database` __optional__ | __String__ | Database to get tables of. Can be empty as long as a default database was set with 'selectDatabase' | - **Returns** → __Array__\<__String__\> -**Example** +**Example Usage** ```js showLineNumbers -const tables = await instance.getTables("awSQL_dev"); // Getting tables of database "awSQL_dev" +const tables = await instance.getTables("awSQL_dev"); +console.log(tables); ``` ```json title="Result" showLineNumbers [ @@ -137,256 +139,50 @@ const tables = await instance.getTables("awSQL_dev"); // Getting tables of datab *** -### select() -→ (`from` = __String__, `...columns`? = __String__) → [Select](./select) +### Query Builders +These methods return specialized query objects that allow for structured queries: -Prepares a new select query. - -**Parameters** - -| Parameter | Type | Description | +| Method | Description | Returns | | -- | -- | -- | -| `from` | __String__ | Name of the table to select from | -| `...columns` __optional__ | __String__ | Names of the columns to include in the query. Leave empty to select all (`*`) | +| `.select(from, ...columns?)` | Prepare a `SELECT` query. | [Select](./select) | +| `.insert(into)` | Prepare an `INSERT` query. | [Insert](./insert) | +| `.delete(from)` | Prepare a `DELETE` query. | [Delete](./delete) | +| `.update(table)` | Prepare an `UPDATE` query. | [Update](./update) | -**Returns** +--- -→ [Select](./select) +### Database & Table Management -*** - -### insert() -→ (`into` = __String__) → [Insert](./insert) - -Prepares a new query to insert data. - -**Parameters** - -| Parameter | Type | Description | +| Method | Description | Returns | | -- | -- | -- | -| `into` | __String__ | Name of the table to insert into | +| `.dropDatabase(database)` | Deletes an entire database (*requires admin privileges*). | [OkPacket](../typedefs/okpacket) | +| `.dropTable(table)` | Deletes a table (*default database must be set*). | [OkPacket](../typedefs/okpacket) | +| `.createDatabase(name)` | Creates a new database (*fails if it already exists*). | [OkPacket](../typedefs/okpacket) | +| `.createTable(name)` | Prepares a new table creation query. | [CreateTable](./create-table) | +| `.alterTable(name)` | Prepares a table modification query. | [AlterTable](./alter-table) | -**Returns** - -→ [Insert](./insert) - -*** - -### delete() -→ (`from` = __String__) → [Delete](./delete) - -Prepares a new query to delete data. - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `from` | __String__ | Name of the table to delete from | - -**Returns** - -→ [Delete](./delete) - -*** - -### update() -→ (`table` = __String__) → [Update](./update) - -Prepares a new query to update data. - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `table` | __String__ | Name of the table to update data of | - -**Returns** - -→ [Update](./update) - -*** - -### dropDatabase() -`async` → (`database` = __String__) → [OkPacket](../typedefs/okpacket) - -Drops a whole database -- Requires admin privileges - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `database` | __String__ | The name of the database to drop | - -**Returns** - -→ [OkPacket](../typedefs/okpacket) - -*** - -### dropTable() -`async` → (`table` = __String__) → [OkPacket](../typedefs/okpacket) - -Drops a whole table. - -:::warning Possible crash -A default database must be set with [selectDatabase()](#selectdatabase) +:::danger Potential Errors +- Creating a database requires **admin privileges**. +- Dropping a table reqeuires **a default database to be selected**. ::: -**Parameters** +--- -| Parameter | Type | Description | +### Structure Management + +| Method | Description | Returns | | -- | -- | -- | -| `table` | __String__ | The name of the table to drop | +| `.createStructure()` | Creates a structure object. | [Structure](./structure) | +| `.getStructure(table, database?)` | Retrieves the structure of a table. | [Structure](./structure) | +| `.checkStructure(table, desiredStructure, database?)` | Compares a table's structure with the expected one. | `{ errors: [], passed: [] }`
✅ If errors.length === 0, the structure is correct. | -**Returns** +--- -→ [OkPacket](../typedefs/okpacket) +### Utility Methods -*** - -### createDatabase() -`async` → (`name` = __String__) → [OkPacket](../typedefs/okpacket) - -Creates a new database. - -:::danger Possible crash -- Requires admin privileges, crashes otherwise -- Crashes if the database already exists -::: - -**Parameters** - -| Parameter | Type | Description | +| Method | Description | Returns | | -- | -- | -- | -| `name` | __String__ | The name of the database to create | +| `.total(table)` | Counts total rows in a table. (*Requires a default database*). | `Number` | +| `.isConnected()` | Checks if the instance is connected. | `Boolean` | -**Returns** - -→ [OkPacket](../typedefs/okpacket) - -*** - -### createTable() -→ (`name` = __String__) → [CreateTable](./create-table) - -Prepares to create a new table. - -:::danger Possible crash -Crashes if the table already exists -::: - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | The name of the table to create | - -**Returns** - -→ [CreateTable](./create-table) - -*** - -### alterTable() -→ (`name` = __String__) → [AlterTable](./alter-table) - -Prepares to alter a table. - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | The name of the table to alter | - -**Returns** - -→ [AlterTable](./alter-table) - -*** - -### createStructure() -→ () → [Structure](./structure) - -Creates a new structure. - -**Returns** - -→ [Structure](./structure) - -*** - -### getStructure() -`async` → (`table` = __String__, `database`? = __String__) → [Structure](./structure) - -Returns the structure object of a table. - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `table` | __String__ | The name of the table to get structure of | -| `database` __optional__ | __String__ | Name of the underlying database. Can be empty when a default database was set with [selectDatabase()](#selectdatabase) | - -**Returns** - -→ [Structure](./structure) - -*** - -### checkStructure() -`async` → (`table` = __String__, `desiredStructure` = [Structure](./structure), `database`? = __String__) → __Object__ - -Checks the structure of a table against a given structure. - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `table` | __String__ | The name of the table to check | -| `desiredStructure` | [Structure](./structure) | The structure to check against | -| `database` __optional__ | __String__ | Name of the underlying database. Can be empty when a default database was set with [selectDatabase()](#selectdatabase) | - -**Returns** - -→ __Object__ - -```js -{ - errors: [<...String>], // Holds error messages - passed: [<...String>] // Holds success messages -} -``` - -:::info -If `errors.length` is `0` the structure is correct -::: - -*** - -### total() -`async` → (`table` = __String__) → __Number__ - -Returns the total amount of rows of a table. -- A default database must be set - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `table` | __String__ | The name of the table to check. | - -**Returns** - -→ __Number__ - -*** - -### isConnected() -→ () → __Boolean__ - -Returns whether the connection has been established. - -**Returns** - -→ __Boolean__ \ No newline at end of file +--- \ No newline at end of file diff --git a/docs/docusaurus/docs/classes/select.md b/docs/docusaurus/docs/classes/select.md index bca19de..2d2e92c 100644 --- a/docs/docusaurus/docs/classes/select.md +++ b/docs/docusaurus/docs/classes/select.md @@ -6,8 +6,12 @@ sidebar_position: 3 Performs a query to retrieve data from a table. +--- + ## Methods +--- + ### selectDatabase() → (`database` = __String__) → `this` @@ -28,9 +32,7 @@ Selects a different database for this query. ### distinct() → () → `this` -Adds the 'distinct' keyword to this query. - -- With 'distinct' only unique values are returned +Ensures that only unique values are returned in the query results. **Returns** @@ -41,21 +43,21 @@ Adds the 'distinct' keyword to this query. Scenario: We want to get the `EmployeeID`s of the Employees that have open orders in [Orders](../example-db/Orders) ```js showLineNumbers -const empOrders = await instance.select("Orders", "EmployeeID") // Select table "Orders" and column "EmployeeID" - .distinct() // Only get unique EmployeeIDs +const empOrders = await instance.select("Orders", "EmployeeID") // Selects "EmployeeID" from "Orders" + .distinct() // Ensures unique EmployeeIDs .execute(); console.log(empOrders); -/* +/* Output: [ - RowDataPacket { EmployeeID: 5 }, - RowDataPacket { EmployeeID: 6 }, - RowDataPacket { EmployeeID: 4 }, - RowDataPacket { EmployeeID: 3 }, - RowDataPacket { EmployeeID: 9 }, - RowDataPacket { EmployeeID: 1 }, - RowDataPacket { EmployeeID: 8 }, - RowDataPacket { EmployeeID: 2 }, - RowDataPacket { EmployeeID: 7 } + { EmployeeID: 5 }, + { EmployeeID: 6 }, + { EmployeeID: 4 }, + { EmployeeID: 3 }, + { EmployeeID: 9 }, + { EmployeeID: 1 }, + { EmployeeID: 8 }, + { EmployeeID: 2 }, + { EmployeeID: 7 } ] */ ``` @@ -65,17 +67,16 @@ console.log(empOrders); ### where() → (`string` = __String__, `values` = __Array__\<__any__\>) → `this` -Adds a where-clause to the query - -- Values should be set as ? in the string and given in left-to-right order via the 'values'-array to minimize the risk of sql-injection -- If you are using joins, specify the table and column together: table.column +Adds a `WHERE` clause to filter results. +- Use `?` as placeholders in the condition string to prevent SQL injection. +- If using joins, specify columns as `table.column`. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `string` | __String__ | The where-clause as a string with ? representing each values. | -| `values` | __Array__\<__any__\> | Array containing values replacing the ? in the string (from left to right) | +| `string` | __String__ | `WHERE` clause with `?` placeholders for values. | +| `values` | __Array__\<__any__\> | Values to replace `?`, in order. | **Returns** @@ -86,35 +87,15 @@ Adds a where-clause to the query Scenario: We only want to get the [Orders](../example-db/Orders) from the Customers with the id `90` and `34` ```js showLineNumbers -const filteredOrders = await instance.select("Orders") // Select table 'Orders' -// Filter by orders where CustomerID are our desired ids. -// Note that the values of ? are pushed in order into the value-array +const filteredOrders = await instance.select("Orders") // Select "Orders" table .where("CustomerID = ? OR CustomerID = ?", [90, 34]) .execute(); console.log(filteredOrders); -/* +/* Output: [ - RowDataPacket { - OrderID: 10248, - CustomerID: 90, - EmployeeID: 5, - OrderDate: '1996-07-04', - ShipperID: 3 - }, - RowDataPacket { - OrderID: 10250, - CustomerID: 34, - EmployeeID: 4, - OrderDate: '1996-07-08', - ShipperID: 2 - }, - RowDataPacket { - OrderID: 10253, - CustomerID: 34, - EmployeeID: 3, - OrderDate: '1996-07-10', - ShipperID: 2 - } + { OrderID: 10248, CustomerID: 90, EmployeeID: 5, OrderDate: '1996-07-04', ShipperID: 3 }, + { OrderID: 10250, CustomerID: 34, EmployeeID: 4, OrderDate: '1996-07-08', ShipperID: 2 }, + { OrderID: 10253, CustomerID: 34, EmployeeID: 3, OrderDate: '1996-07-10', ShipperID: 2 } ] */ ``` @@ -124,17 +105,14 @@ console.log(filteredOrders); ### having() → (`string` = __String__, `values` = __Array__\<__any__\>) → `this` -Same as [where()](#where) but allows for aggregation. - -- Values should be set as ? in the string and given in left-to-right order via the 'values'-array to minimize the risk of sql-injection -- If you are using joins, specify the table and column together: table.column +Same as [.where()](#where), but allows filtering after aggregation. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `string` | __String__ | The having-clause with possible aggregation ? representing each values. | -| `values` | __Array__\<__any__\> | Array containing values replacing the ? in the string (from left to right) | +| `string` | __String__ | `HAVING` clause with `?` placeholders.. | +| `values` | __Array__\<__any__\> | Values to replace `?`, in order. | **Returns** @@ -145,17 +123,15 @@ Same as [where()](#where) but allows for aggregation. ### order() → (`column` = __String__, `desc` = __Boolean__, `aggregation` = __Enum__) → `this` -Adds a new sort order. - -- Can be used multiple times to order by multiple columns +Adds sorting to the query. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `column` | __String__ | Column to order by | -| `desc` | __Boolean__ | Sort descending? Defaults to `false` | -| `aggregation` | __Enum__ → `MIN`/`MAX`/`COUNT`/`SUM`/`AVG` | The aggregation type to use | +| `column` | __String__ | Column to order by. | +| `desc` | __Boolean__ | Sort in descending order? Defaults to `false`. | +| `aggregation` | __Enum__ → `MIN`/`MAX`/`COUNT`/`SUM`/`AVG` | Optional aggregation function. | **Returns** @@ -166,13 +142,13 @@ Adds a new sort order. ### count() → (`doParse` = __Boolean__) → `this` -Counts the number of entries of the first selected column. +Counts the number of rows in the first selected column. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `doParse` | __Boolean__ | If `true` the query will only return a __Number__ of entries. Defaults to `false`. | +| `doParse` | __Boolean__ | If `true`, returns a number instead of an array. Defaults to `false`. | **Returns** @@ -189,7 +165,7 @@ Sums numerical rows of the first selected column. | Parameter | Type | Description | | -- | -- | -- | -| `doParse` | __Boolean__ | If `true` the query will only return a __Number__ of entries. Defaults to `false`. | +| `doParse` | __Boolean__ | If `true`, returns a number. Defaults to `false`. | **Returns** @@ -200,13 +176,13 @@ Sums numerical rows of the first selected column. ### avg() → (`doParse` = __Boolean__) → `this` -Averages numerical rows of the first selected column. +Calculates the average value of numerical rows in the first selected column. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `doParse` | __Boolean__ | If `true` the query will only return a __Number__ of entries. Defaults to `false`. | +| `doParse` | __Boolean__ | If `true`, returns a number. Defaults to `false`. | **Returns** @@ -217,13 +193,13 @@ Averages numerical rows of the first selected column. ### group() → (`...columns` = __String__) → `this` -Groups rows that have the same values into summary rows. +Groups rows by the specified columns. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `...columns` | __String__ | The columns to group by | +| `...columns` | __String__ | Columns to group by. | **Returns** @@ -234,17 +210,17 @@ Groups rows that have the same values into summary rows. ### join() → (`type` = __Enum__, `table` = __String__, `onOriginalColumn` = __String__, `onJoinedColumn` = __String__, `...columns` = __String__) → `this` -Adds a new join to the query. +Performs a `SQL JOIN`. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `type` | __Enum__ → `LEFT`/`INNER`/`RIGHT`/`FULL OUTER` | The join type | -| `table` | __String__ | Table to join on | -| `onOriginalColumn` | __String__ | Column name on the original table to check agains | -| `onJoinedColumn` | __String__ | Column name of the join table to check against | -| `...columns` | __String__ | The columns to join. OG-columns must be set! | +| `type` | __Enum__ → `LEFT`/`INNER`/`RIGHT`/`FULL OUTER` | Type of join. | +| `table` | __String__ | Table to join with. | +| `onOriginalColumn` | __String__ | Column from the original table. | +| `onJoinedColumn` | __String__ | Column from the joined table. | +| `...columns` | __String__ | Columns to select. | **Returns** @@ -255,18 +231,14 @@ Adds a new join to the query. ### limit() → (`number` = __Number__, `offset` = __Number__) → `this` -Limits the query and specifies an offset to start at. - -:::warning -`offset` has no default value and therefore must not be empty! -::: +Limits the number of returned rows and sets an offset. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `number` | __Number__ | Limits the query by specified rows | -| `offset` | __Number__ | Offset to start at. | +| `number` | __Number__ | Maximum rows to return. | +| `offset` | __Number__ | Offset for starting position. | **Returns** @@ -277,14 +249,14 @@ Limits the query and specifies an offset to start at. ### pagination() → (`page` = __Number__, `itemsPerPage` = __Number__) → `this` -Paginates the query. +Applies pagination to the query results. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `page` | __Number__ | The page to get (Minimum 1) | -| `itemsPerPage` | __Number__ | How many items a page should have | +| `page` | __Number__ | The page number (starting from 1). | +| `itemsPerPage` | __Number__ | Number of items per page. | **Returns** @@ -295,11 +267,11 @@ Paginates the query. ### execute() `async` → () → __Number__ / __Array__\<__Object__\> -Executes the prepared query. +Executes the query. **Returns** -→ __Number__ - Numerical results
-→ __Array__\<__Object__\> - Row data +→ __Number__ - if (`doParse` is `true`)
+→ __Array__\<__Object__\> - Query Result *** \ No newline at end of file diff --git a/docs/docusaurus/docs/classes/structure.md b/docs/docusaurus/docs/classes/structure.md index 53be61c..b1e8b56 100644 --- a/docs/docusaurus/docs/classes/structure.md +++ b/docs/docusaurus/docs/classes/structure.md @@ -4,48 +4,52 @@ sidebar_position: 7 # Structure -Defines a new Table structure. +Defines a new table structure for managing columns efficiently. + +--- ## Methods +--- + ### constructor() → (`tableDescription`? = __Array__\<[ColumnStructure](../typedefs/column-structure)\>) → `this` +Create a new `Structure` instance. + **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `tableDescription` __optional__ | __Array__\<[ColumnStructure](../typedefs/column-structure)\> | An array holding a list of column structure objects to define columns with.

You can get a `tableDescription` from a structure with the [get()](#get) method, store it and load it again by creating a [Structure](#structure) with it in this constructor. | +| `tableDescription` __optional__ | __Array__\<[ColumnStructure](../typedefs/column-structure)\> | A list of column structure objects defining table columns.

A table description can be retrieved using the [get()](#get) method and later reloaded by passing it to the `Structure` constructor. | **Returns** -→ `this` +→ `this` - The instance of `Structure`. *** ### get() → () → __Array__\<[ColumnStructure](../typedefs/column-structure)\> -Returns an array containing all defined columns in the [ColumnStructure](../typedefs/column-structure) object. - -With this you can save the structure and load it again by passing it to the [constructor](#constructor) of a new [Structure](#structure). +Retrieves an array of all defined columns in the `Structure` as [ColumnStructure](../typedefs/column-structure) objects. **Returns** -→ __Array__\<[ColumnStructure](../typedefs/column-structure)\> +→ __Array__\<[ColumnStructure](../typedefs/column-structure)\> - A list of defined columns. *** ### drop() → (`name` = __String__) → `this` -Drops (removes) a column from this structure. +Removes a column from the structure. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `name` | __String__ | The column name to drop | +| `name` | __String__ | The column name to remove. | **Returns** @@ -53,527 +57,76 @@ Drops (removes) a column from this structure. *** -### char() -→ (`name` = __String__, `size`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` +## Column Methods -Adds a new column of data type 'char' to this structure +Each of these methods adds a column of the specified type to the structure. -**Parameters** +--- -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of characters to store in this column.

- _Min_: 0
- _Max_: 255
- _Default_: 1 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | +### String-Based Columns -**Returns** +| Method | Parameters | Description | +| -- | -- | -- | +| char(`name`: __String__, `size`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*0-255, default 1*) | Adds a fixed-length character column. | +| varchar(`name`: __String__, `size`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*0-255, default 1*) | Adds a variable-length character column. | +| tinytext(`name`: __String__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | - | Adds a `tinytext` column. | +| text(`name`: __String__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | - | Adds a `text` column. | +| mediumtext(`name`: __String__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | - | Adds a `mediumtext` column. | +| longtext(`name`: __String__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | - | Adds a `longtext` column. | -→ `this` +--- -*** +### Binary Data Columns -### varchar() -→ (`name` = __String__, `size`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` +| Method | Parameters | Description | +| -- | -- | -- | +| binary(`name`: __String__, `size`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*1+, default 1*) | Adds a binary column. | +| varbinary(`name`: __String__, `size`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*0+, default 1*) | Adds a variable-length binary column. | +| tinyblob(`name`: __String__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | - | Adds a `tinyblob` column. | +| blob(`name`: __String__, `size`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*0-65535, default 65535*) | Adds a `blob` column. | +| longblobl(`name`: __String__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | - | Adds a `longblob` column. | -Adds a new column of data type 'varchar' to this structure +--- -**Parameters** +| Method | Parameters | Description | +| -- | -- | -- | +| enum(`name`: __String__, `vals`: __Array__\<__String__\>, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `vals`: *Array of allowed values* | Adds an `enum` column with predefined values. | +| set(`name`: __String__, `vals`: __Array__\<__String__\>, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `vals`: *Array of allowed values* | Adds a `set` column with multiple selectable values. | -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of characters to store in this column.

- _Min_: 0
- _Max_: 255
- _Default_: 1 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | +--- -**Returns** +### Numeric Columns -→ `this` +| Method | Parameters | Description | +| -- | -- | -- | +| bit(`name`: __String__, `size`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*1-64, default 1*) | Adds a `bit` column. | +| tinyint(`name`: __String__, `size`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*1-255, default 255*) | Adds a `tinyint` column. | +| bool(`name`: __String__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | - | Alias for `tinyint(1)`. | +| smallint(`name`: __String__, `size`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*1-255, default 255*) | Adds a `smallint` column. | +| mediumint(`name`: __String__, `size`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*1-255, default 255*) | Adds a `mediumint` column. | +| int(`name`: __String__, `size`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*1-255, default 255*) | Adds an `int` column. | +| bigint(`name`: __String__, `size`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*1-255, default 255*) | Adds a `bigint` column. | -*** +--- -### binary() -→ (`name` = __String__, `size`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` +### Floating Point & Decimal Columns -Adds a new column of data type 'binary' to this structure +| Method | Parameters | Description | +| -- | -- | -- | +| float(`name`: __String__, `p`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `p`: (*1-53, default 25*) | Adds a `float` column. | +| double(`name`: __String__, `size`?: __Number__, `d`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*1+, default 16*)
`d`: (*1+, default 8*) | Adds a `double` dolumn. | +| decimal(`name`: __String__, `size`?: __Number__, `d`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `size`: (*1+, default 16*)
`d`: (*1+, default 8*) | Adds a `decimal` column. | -**Parameters** +--- -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of data.

- _Min_: 1
- _Default_: 1 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | +### Date & Time Columns -**Returns** +| Method | Parameters | Description | +| -- | -- | -- | +| date(`name`: __String__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | - | Adds a `date` column. | +| datetime(`name`: __String__, `fsp`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `fsp`: (*0-6, default 0*) | Adds a `datetime` column. | +| timestamp(`name`: __String__, `fsp`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `fsp`: (*0-6, default 0*) | Adds a `timestamp` column. | +| time(`name`: __String__, `fsp`?: __Number__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | `fsp`: (*0-6, default 0*) | Adds a `time` column. | +| year(`name`: __String__, `options`?: [ConstraintOptions](../typedefs/constraint-options)) | - | Adds a `year` column. | -→ `this` - -*** - -### varbinary() -→ (`name` = __String__, `size`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'varbinary' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of data.

- _Min_: 0
- _Default_: 1 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### tinyblob() -→ (`name` = __String__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'tinyblob' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### tinytext() -→ (`name` = __String__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'tinytext' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### text() -→ (`name` = __String__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'text' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### blob() -→ (`name` = __String__, `size`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'blob' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of characters to store in this column.

- _Min_: 0
- _Max_: 65535
- _Default_: 65535 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### mediumtext() -→ (`name` = __String__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'mediumtext' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### longtext() -→ (`name` = __String__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'longtext' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### longblob() -→ (`name` = __String__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'longblob' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### enum() -→ (`name` = __String__, `vals`? = __Array__\<__String__\>, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'enum' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `vals` | __Array__\<__String__\> | Array of possible values for this column. | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### set() -→ (`name` = __String__, `vals`? = __Array__\<__String__\>, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'enum' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `vals` | __Array__\<__String__\> | Array of possible values for this column. | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### bit() -→ (`name` = __String__, `size`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'bit' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of data.

- _Min_: 1
- _Max_: 64
- _Default_: 1 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### tinyint() -→ (`name` = __String__, `size`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'tinyint' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of data.

- _Min_: 1
- _Max_: 255
- _Default_: 255 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### bool() -→ (`name` = __String__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'bool' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### smallint() -→ (`name` = __String__, `size`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'smallint' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of data.

- _Min_: 1
- _Max_: 255
- _Default_: 255 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### mediumint() -→ (`name` = __String__, `size`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'mediumint' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of data.

- _Min_: 1
- _Max_: 255
- _Default_: 255 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### int() -→ (`name` = __String__, `size`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'int' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of data.

- _Min_: 1
- _Max_: 255
- _Default_: 255 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### bigint() -→ (`name` = __String__, `size`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'bigint' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of data.

- _Min_: 1
- _Max_: 255
- _Default_: 255 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### float() -→ (`name` = __String__, `p`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'float' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `p` __optional__ | __Number__ | Precision.

- _Min_: 1
- _Max_: 53
- _Default_: 25 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### double() -→ (`name` = __String__, `size`? = __Number__, `d`? = __Number__ `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'double' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of data.

- _Min_: 1
- _Default_: 16 | -| `d` __optional__ | __Number__ | Double precision.

- _Min_: 1
- _Default_: 8 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### decimal() -→ (`name` = __String__, `size`? = __Number__, `d`? = __Number__ `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'decimal' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `size` __optional__ | __Number__ | Maximum length of data.

- _Min_: 1
- _Default_: 16 | -| `d` __optional__ | __Number__ | Double precision.

- _Min_: 1
- _Default_: 8 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### date() -→ (`name` = __String__,`options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'date' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### datetime() -→ (`name` = __String__, `fsp`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'datetime' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `fsp` __optional__ | __Number__ | Fractional second precision.

- _Min_: 0
- _Max_: 6
- _Default_: 0 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### timestamp() -→ (`name` = __String__, `fsp`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'timestamp' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `fsp` __optional__ | __Number__ | Fractional second precision.

- _Min_: 0
- _Max_: 6
- _Default_: 0 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### time() -→ (`name` = __String__, `fsp`? = __Number__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'time' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `fsp` __optional__ | __Number__ | Fractional second precision.

- _Min_: 0
- _Max_: 6
- _Default_: 0 | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** - -### year() -→ (`name` = __String__, `options`? = [ConstraintOptions](../typedefs/constraint-options)) → `this` - -Adds a new column of data type 'year' to this structure - -**Parameters** - -| Parameter | Type | Description | -| -- | -- | -- | -| `name` | __String__ | Name of the column | -| `options` __optional__ | [ConstraintOptions](../typedefs/constraint-options) | Additional constraint options | - -**Returns** - -→ `this` - -*** \ No newline at end of file +--- \ No newline at end of file diff --git a/docs/docusaurus/docs/classes/update.md b/docs/docusaurus/docs/classes/update.md index 1890a4c..1f9b31e 100644 --- a/docs/docusaurus/docs/classes/update.md +++ b/docs/docusaurus/docs/classes/update.md @@ -4,26 +4,30 @@ sidebar_position: 6 # Update -Performs a query to update data in a table. +Executes a query to update data in a table. -:::warning Possible crash -To prevent accidental update of all rows, this will throw an error on [execute()](#execute) if no [where()](#where) was defined. +:::warning Possible Crash +To prevent accidental updates on all rows, this operation will **throw an error** when calling [execute()](#execute) if no [where()](#where) clause is defined. -To enable the update of all rows use [force()](#force). +To explicitly allow updates on all rows, use [force()](#force). ::: +--- + ## Methods +--- + ### data() → (`object` = __Object__) → `this` -Updates all matching rows with the given object. +Updates all matching rows with the provided data. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `object` | __Object__ | The object with the data to update to. Keys represent column names. | +| `object` | __Object__ | An object where keys represent column names and values represent the new data. | **Returns** @@ -34,13 +38,13 @@ Updates all matching rows with the given object. ### selectDatabase() → (`database` = __String__) → `this` -Selects a different database for this query. +Selects a different database for the query. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `database` | __String__ | Name of the database to select | +| `database` | __String__ | The name of the database to use for the update. | **Returns** @@ -51,7 +55,7 @@ Selects a different database for this query. ### force() → () → `this` -Enables update of all rows. +Allows updates on **all rows** in the table. **Returns** @@ -62,17 +66,15 @@ Enables update of all rows. ### where() → (`string` = __String__, `values` = __Array__\<__any__\>) → `this` -Adds a where-clause to the query - -- Values should be set as ? in the string and given in left-to-right order via the 'values'-array to minimize the risk of sql-injection -- If you are using joins, specify the table and column together: table.column +Adds a `WHERE` clause to filter the update query. +- Use `?` as placeholders in the condition string to prevent SQL injection. **Parameters** | Parameter | Type | Description | | -- | -- | -- | -| `string` | __String__ | The where-clause as a string with ? representing each values. | -| `values` | __Array__\<__any__\> | Array containing values replacing the ? in the string (from left to right) | +| `string` | __String__ | The `WHERE` clause with `?` placeholders. | +| `values` | __Array__\<__any__\> | An arrray of values replacing the placeholders in *left-to-right* order. | **Returns** @@ -83,7 +85,7 @@ Adds a where-clause to the query ### execute() `async` → () → [OkPacket](../typedefs/okpacket) -Executes the prepared query. +Executes the prepared update query. **Returns** diff --git a/docs/docusaurus/docs/intro.md b/docs/docusaurus/docs/intro.md index a87a6a2..0a2a957 100644 --- a/docs/docusaurus/docs/intro.md +++ b/docs/docusaurus/docs/intro.md @@ -5,39 +5,35 @@ slug: / # Introduction -:::warning Documentation not finished -This documentation is still in development. +*awSQL* is a fast and reliable database query tool designed to: +- ✅ Minimize the risk of SQL injections +- ✅ Maximize usability and safety +- ✅ Prevent accidental bulk row modifications -Some examples might be missing. -::: - -awSQL is a fast and reliable database query tool. - -It is designed to minimize the risk of sql-injections while maximizing usability and safety. - -It prevents you from altering a whole set of rows by accident. - -awSQL is designed to programmatically work with databases in an obvious manner. No more writing pesky and confusing sql-queries. +With awSQL, you can programmatically interact with databases in a clear and intuitive manner - *no more writing complex SQL queries manually!* ## Getting Started -To get started all you need is: +**Requirements** -- An hosted database - - Your credentials +To begin, ensure you have: +- A *hosted database* +- Your *database credentials* -To install `awSQL` you can use npm: +**Installation** -```shell +Install `awSQL` via **npm**: + +```shell showLineNumbers npm i git+https://git.pwcca.eu/Sam/awSQL.git#release ``` - -- Please make sure to use the #release branch to not download the dev-version. +:::warning Important +Always use the `#release` branch to avoid downloading the development version. +::: ## Exports -awSQL exports 2 modules to use: - -- [awSQL](./classes/awSQL) as an instance -- [Structure](./classes/structure) +`awSQL` provides two core modules: +- [awSQL](./classes/awSQL) - The main database instance +- [Structure](./classes/structure) - A module for defining table structures diff --git a/docs/docusaurus/docs/typedefs/column-structure.md b/docs/docusaurus/docs/typedefs/column-structure.md index 7f644b7..a9ac97f 100644 --- a/docs/docusaurus/docs/typedefs/column-structure.md +++ b/docs/docusaurus/docs/typedefs/column-structure.md @@ -4,9 +4,9 @@ sidebar_position: 2 # ColumnStructure -`Object` +**Type:** `Object` -This defines a single column object used by [Structure](../classes/structure). +Represents a single column object used by [Structure](../classes/structure). ## Example structure @@ -33,43 +33,47 @@ The column name. ### .Type → __String__ -The column type. +The column type (e.g., `VARCHAR(255)`, `INT`, `TEXT`). *** ### .Null → __Enum__ → `YES`/`NO` -Whether the column allows null-values. +Specifies whether the column allows `NULL` values. *** ### .Key → __Enum__ → ` `/`PRI`/`MUL`/`UNI` -Key-Values for the table. +Defines the key type for the column. -- ` `(Empty) = None -- `PRI` = Primary -- `MUL` = Indexed -- `UNI` = Unique +| Value | Meaning | +| -- | -- | +| `""` (*empty*) | No key | +| `PRI` | Primary key | +| `MUL` | Indexed (multiple rows can have the same value) | +| `UNI` | Unique (all values must be distinct) | *** ### .Default → __String__ / __null__ -Default value for a new row. +THe default value for the column (if any). *** ### .Extra -→ __Enum__ → ` `/`auto_increment` +→ __Enum__ → `""`/`auto_increment` -Extra values for the table. +Additional attributes for the column. -- ` `(Empty) = None -- `auto_increment` = Primary key will be incremented on new data +| Value | Meaning | +| -- | -- | +| `""` (*empty*) | No extra properties | +| `auto_increment` | The column value auto-increments (typically for primary keys) | *** diff --git a/docs/docusaurus/docs/typedefs/constraint-options.md b/docs/docusaurus/docs/typedefs/constraint-options.md index d465597..4108fa5 100644 --- a/docs/docusaurus/docs/typedefs/constraint-options.md +++ b/docs/docusaurus/docs/typedefs/constraint-options.md @@ -4,18 +4,18 @@ sidebar_position: 3 # ConstraintOptions -`Object` +**Type:** `Object` -An object used to define additional constraints for a column within a [Structure](../classes/structure). +Defines additional constraints for a column within a [Structure](../classes/structure). :::info -All keys within this object are __optional__. - -You only need to define the keys for the settings you want to enable. - -Default values are always `false` on __Booleans__ or `""` on __Strings__ +- **All keys in the object are optional** +- Only define the keys for the constraints you want to enable. ::: + +--- + ## Example structure ```js @@ -30,57 +30,61 @@ Default values are always `false` on __Booleans__ or `""` on __Strings__ } ``` +--- + ## Properties +--- + ### .primary → __Boolean__ -Whether this column should be the primary one. +Defines if this column should be the primary key. *** ### .index → __Boolean__ -Whether this column should be indexable (Faster query, slower insertion) +Marks the column as indexable (improves query speed but slows insertion). *** ### .null → __Boolean__ -Whether this column is null per default +Determines if the column allows `NULL` values by default. *** ### .unique → __Boolean__ -Whether this column data should be unique and block duplicate data. +Ensures that all values in this column are unique, preventing duplicates. *** ### .default → __String__ -Sets the default data for this column that gets inserted if no data was given on insertion. +The default value inserted when no value is providded. *** ### .auto_increment → __Boolean__ -Whether this column should be numerical incremented on new insertions. +Increments the column value automatically on new insertions (typically used for primary keys). *** ### .unsigned → __Boolean__ +Defines whether the column should be **unsigned** (i.e., only allow non-negative numbers). + :::danger Warning -This option is only valid on numerical columns. +This option is **only valid for numerical columns**. ::: -Whether this column should be unsigned. - *** \ No newline at end of file diff --git a/docs/docusaurus/docs/typedefs/okpacket.md b/docs/docusaurus/docs/typedefs/okpacket.md index 6376b6c..f301b66 100644 --- a/docs/docusaurus/docs/typedefs/okpacket.md +++ b/docs/docusaurus/docs/typedefs/okpacket.md @@ -12,29 +12,33 @@ The OkPacket is a response object from MySQL that provides metadata about a succ | Property | Type | Description | | -- | -- | -- | -| `fieldCount` | __Number__ | Defaults to 0 on non-select queries | -| `affectedRows` | __Number__ | The number of rows affected by the query. Does not mean all rows were changed | -| `insertId` | __Number__ | The ID of the last inserted row if the table has an auto-increment column; otherwise always 0 | -| `serverStatus` | __Number__ | A status flag representing the current state of the mysql server | -| `warningCount` | __Number__ | The number of warnings generated during query execution | -| `message` | __String__ | An optional message providin additional information about the query result (normally empty) | -| `protocol41` | __Boolean__ | Whether mysql protocol 4.1 or later is used | -| `changedRows` | __Number__ | The number of rows actually changed by the query | +| `fieldCount` | __Number__ | Defaults to `0` for non-`SELECT` queries. | +| `affectedRows` | __Number__ | The number of rows affected by the query (*does not necessarily mean all rows were changed*). | +| `insertId` | __Number__ | The ID of the last inserted row (*if an auto-increment column exists, otherwise `0`*). | +| `serverStatus` | __Number__ | A bitmask flag representing the current state of the MySQL server. | +| `warningCount` | __Number__ | The number of warnings generated during query execution. | +| `message` | __String__ | An optional message providing additional information about the query result (*typically empty*). | +| `protocol41` | __Boolean__ | `true` if MySQL protocol 4.1 or later is used. | +| `changedRows` | __Number__ | The number of rows actually modified by the query. | -## Common serverStatus +## Common `serverStatus` Flags -:::info `serverStatus` is a bitmask -This means multiple statuses can be set at the same time. For example, if `SERVER_STATUS_AUTOCOMMIT` (__1__) and `SERVER_STATUS_IN_TRANS` (__2__) are both active, the `serverStatus` value will be the combination of the corresponding bits (bitwise OR operation). It therefore will become __3__ +:::info Bitmask Behavior +`serverStatus` is a **bitmask**, meaning multiple statuses can be active at the same time. + +For example: +- `SERVER_STATUS_AUTOCOMMIT` (`1`) + `SERVER_STATUS_IN_TRANS` (`2`) +- These combine to `3` (`1` | `2` = `3`) through a **bitwise OR** operation. ::: | `serverStatus`-Value | Status | Description | | -- | -- | -- | -| __1__ | `SERVER_STATUS_AUTOCOMMIT` | The server is in autocommit mode, meaning each query is treated as a single transaction and is automatically committed | -| __2__ | `SERVER_STATUS_IN_TRANS` | The server is in a transaction. This means that queries are being executed within an open transaction, and they have not been committed yet | -| __8__ | `SERVER_STATUS_MORE_RESULTS_EXISTS` | There are more result set available. This status is seen when a `SELECT` query returns multiple result sets (e.g., when using `SELECT ... INTO OUTFILE`) | -| __16__ | `SERVER_STATUS_NO_GOOD_INDEX_USED` | The server did not use a good index for the query. This might indicate a suboptimal query execution, such as using a less efficient index for the query | -| __32__ | `SERVER_STATUS_NO_INDEX_USED` | The server did not use any __index__ for the query, which may lead to slower performance due to a full table scan | -| __64__ | `SERVER_STATUS_QUERY_NO_GOOD_INDEX_USED` | Indicates that no suitable index was used during the query execution, potentially resulting in performance issues | -| __128__ | `SERVER_STATUS_CURSOR_EXISTS` | A __cursor__ exists and is used for the query. This status is relevant for more complex queries or when cursors are used for querying | -| __256__ | `SERVER_STATUS_LAST_INSERT_ID` | This status indicates that the __last__ `INSERT` __statement__ generated an `AUTO_INCREMENT` ID. It is important for `INSERT` queries, as it relates to auto-generated IDs | -| __512__ | `SERVER_STATUS_DB_DROPPED` | This status indicates that a __database was dropped__ | \ No newline at end of file +| __1__ | `SERVER_STATUS_AUTOCOMMIT` | The server is in **autocommit mode**, treating each query as a seperate transaction that commits automatically. | +| __2__ | `SERVER_STATUS_IN_TRANS` | The server is currently in a **transaction** (*queries have not been committed yet*). | +| __8__ | `SERVER_STATUS_MORE_RESULTS_EXISTS` | More result sets exist (*e.g., when executing a `SELECT ... INTO OUTFILE` query*). | +| __16__ | `SERVER_STATUS_NO_GOOD_INDEX_USED` | The server did not use an **optimal index** for the query, which may indicate inefficient execution. | +| __32__ | `SERVER_STATUS_NO_INDEX_USED` | The query was executed **without an index**, likely causing a full table scan (*may impact performance*). | +| __64__ | `SERVER_STATUS_QUERY_NO_GOOD_INDEX_USED` | No **suitable index** was used during query execution (*could result in performance issues*). | +| __128__ | `SERVER_STATUS_CURSOR_EXISTS` | A **cursor** exists and is in use for this query (*typically seen in more complex queries*). | +| __256__ | `SERVER_STATUS_LAST_INSERT_ID` | The **last executed `INSERT` statement** generated an `AUTO_INCREMENT` ID. | +| __512__ | `SERVER_STATUS_DB_DROPPED` | A **database was dropped** as part of the executed query. | \ No newline at end of file diff --git a/index.js b/index.js index 3336757..09898fb 100644 --- a/index.js +++ b/index.js @@ -16,6 +16,7 @@ const { throwTypeError } = require("./lib/Errors"); * @property {Boolean} [insecureAuth] - Whether insecure authentication methods should be allowed * @property {String} [customIdentifier] - Sets a custom identifier for this instance * @property {Boolean} [isDefault] - Whether this instance is returned by default via 'getInstance' + * @property {object} [ssl] - Whether to use ssl */ /** @@ -40,6 +41,7 @@ class awSQL { insecureAuth: false, customIdentifier: false, isDefault: false, + ssl: false, }){ if (!password) throw new Error(`Can't create instance: No password given`); if (!username) throw new Error(`Can't create instance: No username given`); @@ -106,9 +108,10 @@ class Instance { #multipleStatements; #charset; #connection; + #ssl; #selectedDatabase; - constructor(hostname="localhost", username, password, charset="utf8mb4", defaultDatabase=false, multipleStatements=false, insecureAuth=false){ + constructor(hostname="localhost", username, password, charset="utf8mb4", defaultDatabase=false, multipleStatements=false, insecureAuth=false, ssl=false){ this.#host = hostname; this.#user = username; this.#password = password; @@ -116,6 +119,7 @@ class Instance { this.#multipleStatements = multipleStatements; this.#insecureAuth = insecureAuth; this.#selectedDatabase = defaultDatabase||username; + this.#ssl = ssl; } /** @@ -130,7 +134,8 @@ class Instance { host: this.#host, insecureAuth: this.#insecureAuth, multipleStatements: this.#multipleStatements, - charset: this.#charset + charset: this.#charset, + ssl: this.#ssl }); this.#connection = connection; // Store the connection connection.connect((err) =>{ diff --git a/package.json b/package.json index 5e359c1..545a8c9 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,25 @@ { "name": "awsql", "version": "1.0.0", + "description": "[Documentation](https://docs.pwcca.eu/awSQL)", + "repository": { + "type": "git", + "url": "https://Sam@git.pwcca.eu/Sam/awSQL.git" + }, + "license": "ISC", + "author": "", + "type": "commonjs", "main": "index.js", + "directories": { + "doc": "docs", + "lib": "lib" + }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "", - "license": "ISC", "dependencies": { "dotenv": "^16.4.7", "mysql": "^2.18.1" }, - "description": "" + "devDependencies": {} }