Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -306,31 +306,30 @@ CODE_SNIPPETS = [
|
|
306 |
"db.close()",
|
307 |
"db.run('CREATE TABLE table (column TEXT)')",
|
308 |
"db.run('DROP TABLE table')",
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
|
335 |
|
336 |
|
|
|
306 |
"db.close()",
|
307 |
"db.run('CREATE TABLE table (column TEXT)')",
|
308 |
"db.run('DROP TABLE table')",
|
309 |
+
"db.get('SELECT name FROM sqlite_master WHERE type = \"table\" AND name = ?', ['table'], (err, row) => {})",
|
310 |
+
"db.all('SELECT name FROM sqlite_master WHERE type = \"table\"', (err, rows) => {})",
|
311 |
+
"const { Model } = require('sequelize'); Model.create({ column: 'value' })",
|
312 |
+
"Model.findAll({ where: { column: 'value' } })",
|
313 |
+
"Model.destroy({ where: { id: 1 } })",
|
314 |
+
"Model.update({ column: 'new_value' }, { where: { id: 1 } })",
|
315 |
+
"class Table extends Model {}",
|
316 |
+
"class ChildTable extends ParentTable {}",
|
317 |
+
"Model.init({ id: { type: DataTypes.INTEGER, primaryKey: true } }, { sequelize })",
|
318 |
+
"Model.init({ column: { type: DataTypes.STRING, unique: true } }, { sequelize })",
|
319 |
+
"Model.init({ column: { type: DataTypes.STRING, defaultValue: 'default' } }, { sequelize })",
|
320 |
+
"const csv = require('csv-parser'); fs.createReadStream('data.csv').pipe(csv())",
|
321 |
+
"const xlsx = require('xlsx'); xlsx.writeFile(data, 'data.xlsx')",
|
322 |
+
"const json = JSON.stringify(data)",
|
323 |
+
"const workbook = xlsx.readFile('data.xlsx')",
|
324 |
+
"const mergedWorkbook = xlsx.utils.book_append_sheet(workbook1, workbook2)",
|
325 |
+
"xlsx.utils.book_append_sheet(workbook, worksheet, 'New Sheet')",
|
326 |
+
"const style = workbook.Sheets['Sheet1']['A1'].s",
|
327 |
+
"const color = workbook.Sheets['Sheet1']['A1'].s.fill.fgColor",
|
328 |
+
"const font = workbook.Sheets['Sheet1']['A1'].s.font",
|
329 |
+
"const cellValue = workbook.Sheets['Sheet1']['A1'].v",
|
330 |
+
"workbook.Sheets['Sheet1']['A1'].v = 'New Value'",
|
331 |
+
"const { width, height } = require('image-size')('image.png')",
|
332 |
+
"const sharp = require('sharp'); sharp('image.png').resize(200, 200)"
|
|
|
333 |
|
334 |
|
335 |
|