mrlapizgithub / repl.it-db Goto Github PK
View Code? Open in Web Editor NEWSimple repl.it wrapper
License: Other
Simple repl.it wrapper
License: Other
according to the Readme, I'm supposed to import the Client like this: const Client = require("@replit/database");
I'm working with Typescript, and my config rules don't allow em to use require statements, so I'm attempting to import the Client like this:
import Client from '@replit/database';
However doing this gives me a typescript error:
import Client
This expression is not constructable.
Type 'typeof import("/project/node_modules/@replit/database/index")' has no construct signatures.
I then attempted to change the import to the following:
import { Client } from '@replit/database'
This has Typescript pass the build, letting me create an instance of the client. However, on execution on Replit I get the following error
/home/runner/saitama-bot/dist/controllers/server.js:14
const db = new database_1.Client();
^
TypeError: database_1.Client is not a constructor
at Object.<anonymous> (/home/runner/my-bot/dist/controllers/server.js:14:12)
Now, I believe the first way of importing should have been correct based on the codebase, so I'm wondering if it's an issue with the type declarations for the class that get exported from the package?
Shouldn't it be replit-db? Or would it cause other problems if you changed it
you cant delete items if they start with a /
this means empty also doesn't work.
I'm storing a json string inside of replitdb but if it happens to have a char like \n it'll break. Using db.empty() won't remove the entries.
Image:
https://blocksnmore.is-inside.me/lyF7Ei65.png
Replit project:
https://repl.it/@Blocksnmore/Tempbin#index.js
Code that caused this issue:
https://hastebin.com/owiyirivuj.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.