- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
async Create(id, subscribe_yyyymmdd) {
const query = "INSERT INTO users(id,subscribe_yyyymmdd) VALUES ($1,$2) RETURNING *";
const values = [id, subscribe_yyyymmdd];
try {
const result = await this.db.query(query, values);
return result.rows[0].id;
} catch (error) {
this.logger.error(error);
}
},
async Update() {
const query = "UPDATE users SET subscribe_yyyymmdd = $1 where id=$2 RETURNING *";
const values = [id, subscribe_yyyymmdd];
try {
const result = await this.db.query(query, values);
return result.rows[0].id;
} catch (error) {
this.logger.error(error);
}
},