You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
knex can be used as an SQL query builder in both Node.JS and the browser, limited to WebSQL's constraints (like the inability to drop tables or read schemas)
ORM 동작을 수행하는데, 브라우저에서도 사용이 가능 ?!?!
backstage에서는 backend(nodejs)에서만 실핸한다.
접속 가능한 db는 pg(postgresql), sqlite3, mysql ,oracle 등.
각각의 db client를 설치해주어야 한다.
knex의 transaction api와 javascript의 promise를 조합해서 사용
// Simple read skew exampleconstisolationLevel='read committed';consttrx=awaitknex.transaction({isolationLevel});constresult1=awaittrx(tableName).select();awaitknex(tableName).insert({id: 1,value: 1});constresult2=awaittrx(tableName).select();awaittrx.commit();// result1 may or may not deep equal result2 depending on isolation level
// Simple read skew exampleconstisolationLevel='read committed';consttrx=awaitknex.transaction({isolationLevel});constresult1=awaittrx(tableName).select();awaitknex(tableName).insert({id: 1,value: 1});constresult2=awaittrx(tableName).select();awaittrx.commit();// result1 may or may not deep equal result2 depending on isolation level
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
backstage의 backend는 knex 기반으로 database와 연결
knex can be used as an SQL query builder in both Node.JS and the browser, limited to WebSQL's constraints (like the inability to drop tables or read schemas)
ORM 동작을 수행하는데, 브라우저에서도 사용이 가능 ?!?!
backstage에서는 backend(nodejs)에서만 실핸한다.
접속 가능한 db는 pg(postgresql), sqlite3, mysql ,oracle 등.
각각의 db client를 설치해주어야 한다.
schema builder로 DML 수행
query builder
마치 spring jpa의 querydsl처럼 query builder가 존재하여 아래와 같이 사용할 수 있음.
다만, 일부 기능은 postgresql만 호환된다.
트랜잭션 다루기
batch mode
chunk size를 주어 배치성으로 insert해준다.
그 외 timestamp, uuid 등 유틸 제공
wrapped query
migration
스키마 변경점을 reverse engineering으로 코드화시켜 마이그레이션을 하는 기능으로 보임. django에도 비슷한 기능이 있던걸로...
Beta Was this translation helpful? Give feedback.
All reactions