Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Python AQL builder for ArangoDB, a scalable multi-model database natively supporting documents, graphs and search.
pip install aql-builder --upgrade
Here are simple usage examples:
>>> from aql_builder import AQLBuilder as AB
>>>
>>> AB.for_('my').in_('mycollection').return_('my._key').to_aql()
'FOR my IN mycollection RETURN my._key'
>>>
>>> AB.for_('u').in_('users').replace('u').in_('backup').to_aql()
'FOR u IN users REPLACE u IN backup'
>>>
>>> AB.for_('u').in_('users')
... .filter(
... AB.ref('u.active').eq(True)
... .and_(AB.ref('u.age').gte(35))
... .and_(AB.ref('u.age').lte(37))
... )
... .remove('u').in_('users')
... .to_aql()
'FOR u IN users FILTER (((u.active == true) && (u.age >= 35)) && (u.age <= 37)) REMOVE u IN users'
>>>
Working with query parameters:
>>> from aql_builder import AQLBuilder as AB
>>>
>>> AB.for_('user').in_('@@users').filter(AB.ref('user.age').gte('@min_age')).return_('user._key').to_aql()
'FOR user IN @@users FILTER (user.age >= @min_age) RETURN user._key'
>>>
Working with graph:
>>> from aql_builder import AQLBuilder as AB
>>>
>>> AB.for_('v').in_graph(
... graph='knowsGraph',
... direction='OUTBOUND',
... start_vertex=AB.str('users/1'),
... min_depth=1,
... max_depth=3
... )
... .return_('v._key')
... .to_aql()
'FOR v IN 1..3 OUTBOUND "users/1" GRAPH "knowsGraph" RETURN v._key'
>>>
More complex examples:
>>> from aql_builder import AQLBuilder as AB
>>>
>>> AB.for_('i').in_(AB.range(1, 1000))
... .insert({
... 'id': AB(100000).add('i'),
... 'age': AB(18).add(AB.FLOOR(AB.RAND().times(25))),
... 'name': AB.CONCAT('test', AB.TO_STRING('i')),
... 'active': False,
... 'gender': (
... AB.ref('i').mod(2).eq(0).then('"male"').else_('"female"')
... )
... }).into('users')
... .to_aql()
'FOR i IN 1..1000 INSERT '
'{"id": (100000 + i), '
'"age": (18 + FLOOR((RAND() * 25))), '
'"name": CONCAT(test, TO_STRING(i)), '
'"active": false, '
'"gender": (((i % 2) == 0) ? "male" : "female")} '
'INTO users'
>>>
>>>
>>> AB.for_('u').in_('users')
... .filter(AB.ref('u.active').eq(True))
... .collect({
... 'ageGroup': AB.FLOOR(AB.ref('u.age').div(5)).times(5),
... 'gender': 'u.gender'
... }).into('group')
... .sort('ageGroup', 'DESC')
... .return_({
... 'ageGroup': 'ageGroup',
... 'gender': 'gender'
... })
... .to_aql()
'FOR u IN users '
'FILTER (u.active == true) '
'COLLECT ageGroup = (FLOOR((u.age / 5)) * 5), gender = u.gender INTO group '
'SORT ageGroup DESC '
'RETURN {"ageGroup": ageGroup, "gender": gender}'
>>>
AQL builder is a free software project hosted at https://foss.heptapod.net. Thanks to the support of Clever Cloud, Octobus and the sponsors of the heptapod project.
FAQs
ArangoDB AQL builder
We found that aql-builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.