Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
github.com/jasperalani/mysql-query-builder
Functions that take values and return SQL ready to be queried.
In the future:
select
insert
update
delete
condition.where
Javascript:
let query = ''
queryBuilder.select(['id', 'name'], 'my_table', 'id = 6');
queryBuilder.select(['id', 'name'], 'my_table', condition.where('id', '6', '='));
// SELECT id, name FROM `my_table` WHERE id = 6;
queryBuilder.insert(['name', 'deleted'], ['Jasper', false], 'my_table');
// INSERT INTO `my_table` (name, deleted) VALUES ('Jasper', 'false');
queryBuilder.update(['name', 'deleted'], ['Yasper', true], 'id = 6', 'my_table');
// UPDATE `my_table` SET name = 'Yasper', deleted = 'true' WHERE id = 6;
queryBuilder.delete('id = 6', 'my_table');
// DELETE FROM `my_table` WHERE id = 6;
queryBuilder.select(
'*',
'table',
// condtion funtion
condition.where(['id', 'code'], ['5', 'xxyyzz'], '=')
)
// SELECT * FROM `table` WHERE id = 5 AND code = 'xxyyzz';
Typescript:
const columns: Columns = {
columns: [
{value: 'id'},
{value: 'name'},
{value: 'deleted'}
]
}
const values: Values = {
values: [
{value: 6},
{value: 'value'},
{value: false}
]
}
queryBuilder.insert(columns, values, 'my_table');
queryBuilder.select(columns, 'my_table', 'id = 6');
queryBuilder.update(columns, values, 'id = 6', 'my_table');
queryBuilder.delete('id = 6', 'my_table');
PHP:
$builder = new QueryBuilder();
$select = $builder->select( [ 'column1', 'column2' ], 'table1', 'x = 6' );
$insert = $builder->insert( [ 'column1' ], ['value1'], 'table1' );
$update = $builder->update( [ 'column1', 'column2' ], ['value1', 'value2'], 'table1', 'x = 6' );
$delete = $builder->delete( 'table1', 'x = 6' );
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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.