
Research
Security News
Malicious npm Packages Target BSC and Ethereum to Drain Crypto Wallets
Socket uncovered four malicious npm packages that exfiltrate up to 85% of a victim’s Ethereum or BSC wallet using obfuscated JavaScript.
Async OM it's a super basic Object mapper based almost all on sqlalchemy ORM layer.
We use the declarative extension for building the classes, and also, factor instances of them on querys. (*Limited support)
There is still no support for relations.
Depens on encode/databases dependency.
I don't like the asyncpgsa approach where they are just using, the core layer, to build run the sqlgenerator. I like to build, around the declarative layer of sqlachemy, and later found that I can patch some of the methods on the session.query, to use it's own sql generator, and turn async the query system.
Object persistent is minimal, and needs some love.
from sqlalchemy.ext.declarative import declarative_base
import sqlalchemy as sa
from databases import DatabaseURL
Base = declarative_base()
class OrmTest(Base):
__tablename__ = 'orm_test'
id = sa.Column(sa.Integer, primary_key=True)
name = sa.Column(sa.String(100), index=True)
value = sa.Column(sa.Text)
# Instead of usign Database from databases, you can use:
db = OMDatabase(DatabaseURL('postgres://root@postgres:{port}/guillotina'))
# instances of the object can be created with:
test = OrmTest(name='xx', value='yy')
await db.add(test)
print(test.id) # pk column is correct set
# get an instance
ins = await db.query(OrmTest).get(1)
total = await db.query(OrmTest).count()
assert total == 1
# remove it
await db.delete(ins)
# filter them
res = await db.query(OrmTest).filter(
OrmTest.name.like('xx')).all()
# Or just iterate over the results with a cursor:
async for row in db.query(OrmTest).filter(OrmTest.name.like('xx')):
print(f'Row {row.name}: {row.value}')
# There is basic support for table inheritance query OneToOne
# Look at tests
OMQuery
[vangheem]FAQs
Small and partial Obejct mapper on top of sqlalchemy for async
We found that asyncom demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket uncovered four malicious npm packages that exfiltrate up to 85% of a victim’s Ethereum or BSC wallet using obfuscated JavaScript.
Security News
TC39 advances 9 JavaScript proposals, including Array.fromAsync, Error.isError, and Explicit Resource Management, which are now headed into the ECMAScript spec.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.