
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
github.com/Demitroi/query-builders
Example of SQL Query builders in GOlang to create API REST
We need a mysql/mariadb database server. Create a database and the table from dabatase.sql file. Execute indicating the query builder, for example.
$ go run main.go gendry
Now listening on: http://0.0.0.0:1081
Application started. Press CTRL+C to shut down.
There are 3 query builders available.
Also we can pass database params via args.
$ go run main.go --help
query-builder is an example of mysql databases in golang
Usage:
query-builder [flags] [builder]
Examples:
query-builder gendry
query-builder goqu
query-builder dbx
Flags:
--database-address string Database connection address (default "localhost")
--database-name string Database name (default "query_builders")
--database-password string Database user password
--database-port int Database connection port (default 3306)
--database-protocol string Database connection protocol (default "tcp")
--database-user string Database user (default "root")
-h, --help help for query-builder
-p, --port int Port to serve (default 1081)
GET /api/v1/persons
Query string Params
Field | Type |
---|---|
id | string |
name | string |
city | string |
birth_date_eq | string |
birth_date_gte | string |
birth_date_lte | string |
weight_eq | number |
weight_gte | number |
weight_lte | number |
height_eq | number |
height_gte | number |
height_lte | number |
Example response
[
{
"id": "1",
"name": "Demitroi Marshall",
"city": "Ejido Mezquiral",
"birth_date": "1995-06-07T08:00:00Z",
"weight": 85,
"height": 181
},
{
"id": "6",
"name": "John Cena",
"city": "Tampa",
"birth_date": "1977-04-23T08:00:00Z",
"weight": 112,
"height": 184
}
]
GET /api/v1/persons/:id
Example response
{
"id":"1",
"name":"Demitroi Marshall",
"city":"San Luis Rio Colorado",
"birth_date":"1995-06-07T08:00:00Z",
"weight":85,
"height":181
}
POST /api/v1/persons
Example request
{
"name": "John Cena",
"city": "Tampa",
"birth_date": "1977-04-23T08:00:00Z",
"weight": 112,
"height": 184
}
Example Response
{
"id": "6"
}
POST /api/v1/persons/6
Example request
{
"name": "John Cena",
"city": "Tampa",
"birth_date": "1977-04-23T08:00:00Z",
"weight": 112,
"height": 184
}
Example Response
{
"msg": "OK"
}
Delete /api/v1/persons/:id
Example response
{
"msg": "OK"
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.