db + it ops db kysely Merge temp table as source table · Issue #959 · kysely-org/kyselyIs there a way to use temp table as the source table in merge statement something like this? await db.mergeInto('mainTable').using('tempData', 'mainTable.itemCode', 'tempData.itemCode').whenMatched()...... SQL Statement MERGE INTO MainTa... wono | discuss | tweet + it ops db kysely merge JSON utilities for `selectNoFrom` · Issue #1294 · kysely-org/kyselyDiscussed in https://discord.com/channels/890118421587578920/1315878442281209907/1315878442281209907 Currently, all the json utilities expect a column. While it is possible to use these utilities via CTEs: const exampleJson = { foo: { ba... wono | discuss | tweet + it ops db merge MERGE 문 사용법 (DUAL, UPDATE와 INSERT를 한번에)MERGE 문을 사용하면 변경할 테이블에 데이터가 존재하는지 체크하고, UPDATE, DELETE, INSERT를 한 번에 작업이 가능하다. MERGE 문을 사용하지 않을 경우 해당 조건으로 테이블을 SELECT 한 후 IF 조건을 사용하여 UPDATE나 INSERT로 분기하는 로직을 작성해야 하는 번거로움이 있다. MERGE 문의 경우 단일(한개의) 테이블에 UPDATE 또는 INSERT를 하는 경우 많이 사용하지만, 두개의 테이블을 비교하거나 서브 쿼리의 결과에 따라서 UPDATE, INSERT 작업이 가능하다. MSSQL MERGE 문 단일 테이블 사용법 (DUAL) 오라클에서는 DUAL이라는 dummy 테이블을 USING 절에 사용하면 단일 테이블 작업이 간단하지만, MSSQL에서는 DUAL 테이.. wono | discuss | tweet + it ops db postgresql merge PostgreSQL 15にMERGE文UPSERTがやってくる | DevelopersIOPostgreSQL 15がMERGE文を使ったUPSERTに対応します wono | discuss | tweet + it ops db postgresql merge Postgresql 로 Upsert 하기Postgres 9.5(2016년 1월 7일 이후 출시) 이후 가능한 문법입니다.존재하지 않는 경우 삽입, 존재하는 경우 Nothing존재하지 않는 경우 삽입, 존재하는 경우 Update삽입이 되었으면, id 반환삽입이 된 경우 삽입된 id값을 반환한다.Serial, wono | discuss | tweet + it ops db softdelete postgresql Soft deletion with PostgreSQL: but with logic on the database!—Martian Chronicles, Evil Martians’ team blogRubyists might take special pleasure here, but every SQL and PostgreSQL dev can learn this unorthodox approach: putting soft delete logic on the database side. wono | discuss | tweet + it ops db survey erd 설문조사 데이터 모델링1. 비즈니스 규칙 wono | discuss | tweet + it ops db survey erd [JEB Survey] 설문 조사 프로젝트📌 GitHub 주소https://github.com/HuiEun-Lim/JEB-Survey wono | discuss | tweet + it ops db survey erd A Database Model for an Online Survey. Part 1I need to create the design for a new database which will be the data layer for an application; the application will be an online survey or polling like Survey Monkey. My challenge is that the functionality that I require is not supported by existing survey sites, so I need to build my own. What I need is a conditional survey (if the answer to question 4 is “yes,” then we ask question 5 and skip question 6; but if the answer to question 4 is “no,” then we skip question 5 and ask question 6) (...) wono | discuss | tweet + it ops db postgresql unique index PostgreSQL, unique index 컬럼에 null 삽입으로 인한 중복 생성 문제null도 중복처리 될 줄 알았지 .. wono | discuss | tweet + it ops db softdelete unique Soft Delete and Unique ConstraintWhen using the soft delete mechanism on the database, you might run into a situation where a record with a unique constraint was deleted and you want to reuse the unique value. If the unique value is… wono | discuss | tweet + it ops db softdelete unique SQL: Soft Deleting and Unique ConstraintOne issue with soft delete, it's not compatible with unique constraints. wono | discuss | tweet + it ops db softdelete unique MySQL에서 이메일 재사용 가능하게 하기- Soft Delete와 Unique를 함께 활용하다.MySQL에서 회원탈퇴시 탈퇴한 회원 정보를 DB에서 완전히 삭제하지 않고 softDelete 처리했을 때, 해당 이메일을 중복확인에서 통과시키고 재사용할 수 있게한 고민들 wono | discuss | tweet + it ops db soft delete unique [MySQL] Soft delete와 unique constraintSoft delete인데 unique가 걸려있다... 제목을 어떻게 지어야할지 몰라서 저렇게 지었지만 회사 API 작성 중 회원가입 파트에서 막힌 부분이 있었다. 바로 탈퇴한 아이디인데 그 아이디로 다시 회원가입을 할 경우, 로직상 DB에서 레코드(row)를 삭제하는 것이 아닌, soft delete(논리 삭제)를 할 경우 unique해야 할 아이디가 이미 테이블에 존재한다며 에러를 내뿜었다. 이 부분에 대해 고민을 한 것이 2가지였다. unique constraint를 없애고 비지니스 로직으로 논리 삭제된 아이디를 제외하고 중복된 아이디인지 검사 nickname과 deleted_at 컬럼 두개를 다중 컬럼 unique를 건다. unique 삭제? unique 조건을 삭제한다면 문제가 분명히 생길 것이다.. wono | discuss | tweet + it ops db common 요즘 트랜드는 공통코드를 사용하지 않는 건가요? | OKKY Q&A안녕하세요.프로젝트를 수행중인 시니어 개발자로 요즘은 관리만 하고 있습니다. 주니어, 중니어 개발자들이 주도적으로 설계,구현을 하고 있습니다. 요즘 트랜드는 공통코드를 사용하지 않는 건가요?물론, 업무에 따라, 업무로직에 따라 공통코드를 사용하지 않을 수는 있습니다.근데, 라떼는 공통코드는 기본으로 무조건 만들고 시작했었는데... 개발자들이 구현해 놓은거 wono | discuss | tweet + it ops db common [DB 설계] 공통코드 테이블 설계개요 하나의 서비스를 만들면 서비스 내에서 정의하여 사용하는 수많은 코드 데이터들이 있다. 이런 코드들을 한데 모아서 관리하기 위한 목적으로 설계하는 것이 공통코드 테이블이다. 관리자 페이지가 따로 존재하는 경우에는 필수적으로 "공통 코드 관리" 메뉴를 확인할 수 있게 된다. 이는 거의 프로젝트 초반에 가장 먼저 설계하는 테이블들 중 하나이다. 어쨋든 우리는 서비스를 만들때 내부에서 많은 코드들을 정의해서 사용하곤 한다. 어떤 경우에는 해당 코드들을 테이블에서 관리하지 않고 소스 코드에서 관리하는 경우도 있다. (일정 규모 이상의 서비스를 만들고 있다면, 소스 코드에서 관리하는 일은 없다고 본다.) 소스코드에서 관리하게 되면 데이터를 조회 할때 그 코드값이 무엇을 의미하는지 소스코드를 직접 확인해야 한다.. wono | discuss | tweet + it ops db dbeaver How to Install Git Extension in Dbeaver and Connect your RepositoryIn a recent consultation with an international client, I focused on improving their data quality process. One of the tools I utilised was DBeaver, a versatile platform for managing multiple databases… wono | discuss | tweet + it ops db mysql dump mysql DUMP사용dump 옵션 –single-transaction : dump를 하나의 트랜잭션을 이용해서 실행함 (InnoDB 스토리지 엔진을 사용하는 테이블에 대해서는 Lock없이 일관된 덤프를 받을 수 있음). 자세한 내용은 아래 “일관된 데이터 덤프 받기” 참조 –flush-logs : dump를 시작하는 시점에 binary log를 rotation 시키도록 한다. Binary log를 증분 백업용으로 사용하는 경우, 풀백업과 증분 백업의 구분을 명확히 할 수 있다. –master-data : 이… wono | discuss | tweet + it ops db mysql dump mysqldump 사용시 주의점mysqldump는 mysql, mariadb 에서 데이터 백업시 주로 사용하는 백업방법 중 하나이다. 개발 DB에서 사용할 때는 문제가 없지만 서비스 DB에서 이걸 사용한다면 한가지 주의할 점이 있다. 모르고 그냥 사용하게 된다면 TABLE LOCK 때문에 서비스 장애를 일으킬 수 있다. mysqldump는 여러 옵션이 있는데 그것을 모르고 default 옵션만 놓고 사용한다면 문제가 발생한다. 1. default 옵션사용시 ex) mysqldump -uroot -p비번 xxxxDB TB_TEST_HIST > TB_TEST_HIST_20230110.sql MariaDB [(none)]> show processlist; +----------+-------------+---------------------.. wono | discuss | tweet + it ops db mysql dump [Mysql] mysql dump 사용법데이터 백업 : mysqldump는 모든 데이터베이스 테이블의 내용을 SQL 명령으로 추출하여, 이를 통해 테이블 생성과 데이터 삽입을 할 수 있는 SQL 스크립트를 생성합니다.데이터 복원 : 생성된 덤프 파일은 mysql 명령어 라인 유틸리티를 사용하여 MySQL 데 wono | discuss | tweetNext
+ it ops db kysely Merge temp table as source table · Issue #959 · kysely-org/kyselyIs there a way to use temp table as the source table in merge statement something like this? await db.mergeInto('mainTable').using('tempData', 'mainTable.itemCode', 'tempData.itemCode').whenMatched()...... SQL Statement MERGE INTO MainTa... wono | discuss | tweet
+ it ops db kysely merge JSON utilities for `selectNoFrom` · Issue #1294 · kysely-org/kyselyDiscussed in https://discord.com/channels/890118421587578920/1315878442281209907/1315878442281209907 Currently, all the json utilities expect a column. While it is possible to use these utilities via CTEs: const exampleJson = { foo: { ba... wono | discuss | tweet
+ it ops db merge MERGE 문 사용법 (DUAL, UPDATE와 INSERT를 한번에)MERGE 문을 사용하면 변경할 테이블에 데이터가 존재하는지 체크하고, UPDATE, DELETE, INSERT를 한 번에 작업이 가능하다. MERGE 문을 사용하지 않을 경우 해당 조건으로 테이블을 SELECT 한 후 IF 조건을 사용하여 UPDATE나 INSERT로 분기하는 로직을 작성해야 하는 번거로움이 있다. MERGE 문의 경우 단일(한개의) 테이블에 UPDATE 또는 INSERT를 하는 경우 많이 사용하지만, 두개의 테이블을 비교하거나 서브 쿼리의 결과에 따라서 UPDATE, INSERT 작업이 가능하다. MSSQL MERGE 문 단일 테이블 사용법 (DUAL) 오라클에서는 DUAL이라는 dummy 테이블을 USING 절에 사용하면 단일 테이블 작업이 간단하지만, MSSQL에서는 DUAL 테이.. wono | discuss | tweet
+ it ops db postgresql merge PostgreSQL 15にMERGE文UPSERTがやってくる | DevelopersIOPostgreSQL 15がMERGE文を使ったUPSERTに対応します wono | discuss | tweet
+ it ops db postgresql merge Postgresql 로 Upsert 하기Postgres 9.5(2016년 1월 7일 이후 출시) 이후 가능한 문법입니다.존재하지 않는 경우 삽입, 존재하는 경우 Nothing존재하지 않는 경우 삽입, 존재하는 경우 Update삽입이 되었으면, id 반환삽입이 된 경우 삽입된 id값을 반환한다.Serial, wono | discuss | tweet
+ it ops db softdelete postgresql Soft deletion with PostgreSQL: but with logic on the database!—Martian Chronicles, Evil Martians’ team blogRubyists might take special pleasure here, but every SQL and PostgreSQL dev can learn this unorthodox approach: putting soft delete logic on the database side. wono | discuss | tweet
+ it ops db survey erd [JEB Survey] 설문 조사 프로젝트📌 GitHub 주소https://github.com/HuiEun-Lim/JEB-Survey wono | discuss | tweet
+ it ops db survey erd A Database Model for an Online Survey. Part 1I need to create the design for a new database which will be the data layer for an application; the application will be an online survey or polling like Survey Monkey. My challenge is that the functionality that I require is not supported by existing survey sites, so I need to build my own. What I need is a conditional survey (if the answer to question 4 is “yes,” then we ask question 5 and skip question 6; but if the answer to question 4 is “no,” then we skip question 5 and ask question 6) (...) wono | discuss | tweet
+ it ops db postgresql unique index PostgreSQL, unique index 컬럼에 null 삽입으로 인한 중복 생성 문제null도 중복처리 될 줄 알았지 .. wono | discuss | tweet
+ it ops db softdelete unique Soft Delete and Unique ConstraintWhen using the soft delete mechanism on the database, you might run into a situation where a record with a unique constraint was deleted and you want to reuse the unique value. If the unique value is… wono | discuss | tweet
+ it ops db softdelete unique SQL: Soft Deleting and Unique ConstraintOne issue with soft delete, it's not compatible with unique constraints. wono | discuss | tweet
+ it ops db softdelete unique MySQL에서 이메일 재사용 가능하게 하기- Soft Delete와 Unique를 함께 활용하다.MySQL에서 회원탈퇴시 탈퇴한 회원 정보를 DB에서 완전히 삭제하지 않고 softDelete 처리했을 때, 해당 이메일을 중복확인에서 통과시키고 재사용할 수 있게한 고민들 wono | discuss | tweet
+ it ops db soft delete unique [MySQL] Soft delete와 unique constraintSoft delete인데 unique가 걸려있다... 제목을 어떻게 지어야할지 몰라서 저렇게 지었지만 회사 API 작성 중 회원가입 파트에서 막힌 부분이 있었다. 바로 탈퇴한 아이디인데 그 아이디로 다시 회원가입을 할 경우, 로직상 DB에서 레코드(row)를 삭제하는 것이 아닌, soft delete(논리 삭제)를 할 경우 unique해야 할 아이디가 이미 테이블에 존재한다며 에러를 내뿜었다. 이 부분에 대해 고민을 한 것이 2가지였다. unique constraint를 없애고 비지니스 로직으로 논리 삭제된 아이디를 제외하고 중복된 아이디인지 검사 nickname과 deleted_at 컬럼 두개를 다중 컬럼 unique를 건다. unique 삭제? unique 조건을 삭제한다면 문제가 분명히 생길 것이다.. wono | discuss | tweet
+ it ops db common 요즘 트랜드는 공통코드를 사용하지 않는 건가요? | OKKY Q&A안녕하세요.프로젝트를 수행중인 시니어 개발자로 요즘은 관리만 하고 있습니다. 주니어, 중니어 개발자들이 주도적으로 설계,구현을 하고 있습니다. 요즘 트랜드는 공통코드를 사용하지 않는 건가요?물론, 업무에 따라, 업무로직에 따라 공통코드를 사용하지 않을 수는 있습니다.근데, 라떼는 공통코드는 기본으로 무조건 만들고 시작했었는데... 개발자들이 구현해 놓은거 wono | discuss | tweet
+ it ops db common [DB 설계] 공통코드 테이블 설계개요 하나의 서비스를 만들면 서비스 내에서 정의하여 사용하는 수많은 코드 데이터들이 있다. 이런 코드들을 한데 모아서 관리하기 위한 목적으로 설계하는 것이 공통코드 테이블이다. 관리자 페이지가 따로 존재하는 경우에는 필수적으로 "공통 코드 관리" 메뉴를 확인할 수 있게 된다. 이는 거의 프로젝트 초반에 가장 먼저 설계하는 테이블들 중 하나이다. 어쨋든 우리는 서비스를 만들때 내부에서 많은 코드들을 정의해서 사용하곤 한다. 어떤 경우에는 해당 코드들을 테이블에서 관리하지 않고 소스 코드에서 관리하는 경우도 있다. (일정 규모 이상의 서비스를 만들고 있다면, 소스 코드에서 관리하는 일은 없다고 본다.) 소스코드에서 관리하게 되면 데이터를 조회 할때 그 코드값이 무엇을 의미하는지 소스코드를 직접 확인해야 한다.. wono | discuss | tweet
+ it ops db dbeaver How to Install Git Extension in Dbeaver and Connect your RepositoryIn a recent consultation with an international client, I focused on improving their data quality process. One of the tools I utilised was DBeaver, a versatile platform for managing multiple databases… wono | discuss | tweet
+ it ops db mysql dump mysql DUMP사용dump 옵션 –single-transaction : dump를 하나의 트랜잭션을 이용해서 실행함 (InnoDB 스토리지 엔진을 사용하는 테이블에 대해서는 Lock없이 일관된 덤프를 받을 수 있음). 자세한 내용은 아래 “일관된 데이터 덤프 받기” 참조 –flush-logs : dump를 시작하는 시점에 binary log를 rotation 시키도록 한다. Binary log를 증분 백업용으로 사용하는 경우, 풀백업과 증분 백업의 구분을 명확히 할 수 있다. –master-data : 이… wono | discuss | tweet
+ it ops db mysql dump mysqldump 사용시 주의점mysqldump는 mysql, mariadb 에서 데이터 백업시 주로 사용하는 백업방법 중 하나이다. 개발 DB에서 사용할 때는 문제가 없지만 서비스 DB에서 이걸 사용한다면 한가지 주의할 점이 있다. 모르고 그냥 사용하게 된다면 TABLE LOCK 때문에 서비스 장애를 일으킬 수 있다. mysqldump는 여러 옵션이 있는데 그것을 모르고 default 옵션만 놓고 사용한다면 문제가 발생한다. 1. default 옵션사용시 ex) mysqldump -uroot -p비번 xxxxDB TB_TEST_HIST > TB_TEST_HIST_20230110.sql MariaDB [(none)]> show processlist; +----------+-------------+---------------------.. wono | discuss | tweet
+ it ops db mysql dump [Mysql] mysql dump 사용법데이터 백업 : mysqldump는 모든 데이터베이스 테이블의 내용을 SQL 명령으로 추출하여, 이를 통해 테이블 생성과 데이터 삽입을 할 수 있는 SQL 스크립트를 생성합니다.데이터 복원 : 생성된 덤프 파일은 mysql 명령어 라인 유틸리티를 사용하여 MySQL 데 wono | discuss | tweet