{"id":18360186,"url":"https://github.com/denzelcode/advancedsql","last_synced_at":"2025-09-15T20:24:54.646Z","repository":{"id":41001980,"uuid":"259896141","full_name":"DenzelCode/AdvancedSQL","owner":"DenzelCode","description":"The best Java query builder/SQL connector.","archived":false,"fork":false,"pushed_at":"2023-06-14T22:31:24.000Z","size":2648,"stargazers_count":32,"open_issues_count":2,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T13:37:19.231Z","etag":null,"topics":["builder","generator","java","mysql","query","query-builder","sql"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DenzelCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-29T10:35:45.000Z","updated_at":"2024-06-12T11:53:51.000Z","dependencies_parsed_at":"2022-09-06T13:40:07.729Z","dependency_job_id":"da7cbaeb-f4df-464b-97ca-d6ffcc9cd504","html_url":"https://github.com/DenzelCode/AdvancedSQL","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/DenzelCode/AdvancedSQL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenzelCode%2FAdvancedSQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenzelCode%2FAdvancedSQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenzelCode%2FAdvancedSQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenzelCode%2FAdvancedSQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DenzelCode","download_url":"https://codeload.github.com/DenzelCode/AdvancedSQL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenzelCode%2FAdvancedSQL/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266606627,"owners_count":23955318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["builder","generator","java","mysql","query","query-builder","sql"],"created_at":"2024-11-05T22:26:56.494Z","updated_at":"2025-09-15T20:24:49.585Z","avatar_url":"https://github.com/DenzelCode.png","language":"Java","readme":"# AdvancedSQL\nThe best Java query builder/SQL connector.\n\n## What's AdvancedSQL?\nAdvancedSQL is a SQL query builder and/or connector that helps you to generate/modify information on the database without even have to write any line of SQL code, which sometimes is kindof boring and tiring. AdvancedSQL is the best exit for that developers who wants to continue coding without having to write out-of-syntax code (SQL queries) on Java code.\n\n## Download\nDownload the latest JAR: https://github.com/DenzelCode/AdvancedSQL/releases/latest\n\n## Dependency for maven:\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.code\u003c/groupId\u003e\n    \u003cartifactId\u003eadvancedsql\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.0\u003c/version\u003e\n    \u003cscope\u003esystem\u003c/scope\u003e\n    \u003csystemPath\u003e${project.basedir}/lib/AdvancedSQL.jar\u003c/systemPath\u003e\n\u003c/dependency\u003e\n```\n\n## Examples:\n**Connect to the Database:**\nThere is no need to create the database manually, AdvancedSQL does it for you.\n```java\nimport com.code.advancedsql.*;\n\ntry {\n    MySQL mySQL = new MySQL(\"127.0.0.1\", 3306, \"root\", \"password\", \"database\");\n\n    if (mySQL.isConnected()) {\n        System.out.println(\"Connected!\");\n    }\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n**Create table:**\n```java\nimport com.code.advancedsql.*;\nimport com.code.advancedsql.table.ITable;\n\ntry {\n    MySQL mySQL = connect();\n\n    // Table\n    ITable table = mySQL.table(\"users\");\n\n    // Create table\n    Create create = table.create().ifNotExists();\n\n    // Table columns\n    create.id();\n    create.string(\"first_name\");\n    create.string(\"last_name\");\n    create.string(\"test\");\n\n    Boolean result = create.execute();\n\n    // Print query string and result.\n    System.out.println(create);\n    System.out.println(result);\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n**Alter table:**\n```java\nimport com.code.advancedsql.*;\nimport com.code.advancedsql.query.action.Add;\nimport com.code.advancedsql.query.action.Modify;\n\ntry {\n    MySQL mySQL = connect();\n\n    // Alter columns\n    Alter alter = mySQL.table(\"users\").alter();\n\n    // Add columns\n    Add add = alter.add();\n    add.string(\"token\").nullable();\n    add.string(\"connection_id\").nullable();\n\n    // Drop columns\n    com.code.advancedsql.query.action.Drop drop = alter.drop();\n    drop.column(\"test\");\n\n    // Modify columns\n    Modify modify = alter.modify();\n    modify.integer(\"connection_id\").nullable();\n\n    // Execute query\n    Boolean result = alter.execute();\n\n    // Print query string and result.\n    System.out.println(alter);\n    System.out.println(result);\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n**Insert:**\n```java\nimport com.code.advancedsql.*;\n\ntry {\n    MySQL mySQL = connect();\n\n    // Insert\n    Insert query = mySQL.table(\"users\").insert();\n    \n    query.field(\"first_name\", \"Denzel\");\n    query.field(\"last_name\", \"Code\");\n    \n    int execute = query.execute();\n\n    // Print query string and result.\n    System.out.println(query);\n    System.out.println(execute);\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n**Insert HashMap:**\n```java\nimport com.code.advancedsql.*;\n\ntry {\n    MySQL mySQL = connect();\n\n    // Insert\n    Insert query = mySQL.table(\"users\").insert(new HashMap\u003c\u003e(){{\n        put(\"first_name\", \"Denzel\");\n        put(\"last_name\", \"Code\");\n    }});\n    int execute = query.execute();\n\n    // Print query string and result.\n    System.out.println(query);\n    System.out.println(execute);\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n\n**Update:**\n```java\nimport com.code.advancedsql.*;\n\ntry {\n    MySQL mySQL = connect();\n\n    // Update\n    Update query = mySQL.table(\"users\").update().where(\"first_name = ?\", \"Denzel\");\n    \n    query.field(\"token\", \"Advanced\");\n    \n    int execute = query.execute();\n\n    // Print query string and result.\n    System.out.println(query);\n    System.out.println(execute)p\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n**Update HashMap:**\n```java\nimport com.code.advancedsql.*;\n\ntry {\n    MySQL mySQL = connect();\n\n    // Update\n    Update query = mySQL.table(\"users\").update(new HashMap\u003c\u003e(){{\n        put(\"token\", \"Advanced\");\n    }}).where(\"first_name = ?\", \"Denzel\");\n    int execute = query.execute();\n\n    // Print query string and result.\n    System.out.println(query);\n    System.out.println(execute)p\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n**Select:**\n```java\nimport com.code.advancedsql.*;\n\ntry {\n    MySQL mySQL = connect();\n\n    // Select\n    Select query = mySQL.table(\"users\").select();\n    Map\u003cString, Object\u003e fetch = query.fetch();\n\n    // Print query string and result.\n    System.out.println(query);\n    System.out.println(fetch);\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n**Select with join:**\n```java\nimport com.code.advancedsql.*;\nimport com.code.advancedsql.query.action.Add;\nimport com.code.advancedsql.query.action.Modify;\nimport com.code.advancedsql.table.ITable;\n\ntry {\n    MySQL mySQL = connect();\n\n    // Create information table\n    ITable table = mySQL.table(\"information\");\n\n    // Delete table if exists.\n    if (mySQL.table(\"information\").exists()) table.drop().execute();\n\n    // Create table\n    Create create = table.create();\n\n    // Table columns\n    create.id();\n    create.integer(\"user_id\").nullable();\n    create.string(\"address\").nullable();\n    Boolean execute = create.execute();\n\n    // Print query and result.\n    System.out.println(create);\n    System.out.println(execute);\n\n    // Insert value\n    table.insert(new HashMap\u003c\u003e(){{\n        put(\"user_id\", 1);\n        put(\"address\", \"20 Cooper Square\");\n    }}).execute();\n\n    table = mySQL.table(\"users\");\n\n    Select query = table.select(new String[]{\"information.address\", \"users.first_name\"})\n            .innerJoin(\"information\")\n            .on(\"users.id = information.user_id\")\n            .where(\"first_name = ?\", \"Denzel\");\n\n    Map\u003cString, Object\u003e user = query.fetch();\n\n    // Print query and result.\n    System.out.println(query);\n    System.out.println(user);\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n**Delete:**\n```java\nimport com.code.advancedsql.*;\n\ntry {\n    MySQL mySQL = connect();\n\n    // Delete\n    Delete query = mySQL.table(\"users\").delete().where(\"first_name = ?\", \"Denzel\");\n    int execute = query.execute();\n\n    // Print query and result.\n    System.out.println(query);\n    System.out.println(execute);\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n**Truncate:**\n```java\nimport com.code.advancedsql.*;\n\ntry {\n    MySQL mySQL = connect();\n\n    // Truncate table\n    Truncate query = mySQL.table(\"users\").truncate();\n    Boolean execute = query.execute();\n\n    // Print query and result.\n    System.out.println(query);\n    System.out.println(execute);\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n**Drop:**\n```java\nimport com.code.advancedsql.*;\n\ntry {\n    MySQL mySQL = connect();\n\n    // Drop table\n    Drop query = mySQL.table(\"users\").drop();\n    Boolean execute = query.execute();\n\n    // Print query and result.\n    System.out.println(query);\n    System.out.println(execute);\n} catch (SQLException e) {\n    e.printStackTrace();\n}\n```\n\n## Licensing information\nThis project is licensed under LGPL-3.0. Please see the [LICENSE](/LICENSE) file for details.\n\n## Donations\n* [PayPal](https://paypal.me/DenzelGiraldo)\n","funding_links":["https://paypal.me/DenzelGiraldo"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenzelcode%2Fadvancedsql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenzelcode%2Fadvancedsql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenzelcode%2Fadvancedsql/lists"}