Giter VIP home page Giter VIP logo

dndb's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dndb's Issues

Forced to add callback

In your README for dndb you say that a callback for insert is optional, but when i use it, Type yells at me and tells me that I have to add a callback

image

I think you only need to add a ? after cb

type errors with any's

Hello ๐Ÿ‘‹

Neat Project! I am looking for something of a lite nosql db for small docs and found this project.

When I went to work with it using typescript, I ran into a few type warnings with the any type.

So I added some types to the src/mod.ts file, would you be interested in reviewing and see it this is worthy of a PR?

If you get a chance check it out. - https://github.com/hyper63/dndb/blob/main/src/mod.ts

It did make my type errors go away, but I had to use ts-ignore, which I know is not great, I will have to look into better solutions to add types to the executor add function, since it may return different results based on the initial argument.

Thanks again for the project, if this change is in the direction you are looking for, let me know and I will submit a PR.

Cheers!

Crash app with DNDB high load!

Hi!
I wrote a simple test and I want to share it with you.

  1. Test code:

1

In this example i run simple visit counter

  1. Run it

2

And all well done! In DB i see correct counter value.

But if i press and hold F5 key (Firefox) - this allows you to simulate a large request frequency per second of time.

DNDB make db.update file and crash all app

3

please tell me how to disable db. update or optimize dndb for high loads?

P.S ( deno - 1.7.0 & dndb 0.2.6 )

Permission denied!

Hi!
I noticed a serious problem in Docker.
Any request to the DB crashes the app.

I write this Dockerfile:
the example is taken from: https://github.com/hayd/deno-docker


FROM hayd/alpine-deno:1.7.2
EXPOSE 8080
WORKDIR /app
USER deno
ADD . .
RUN deno cache --unstable app.js
CMD ["run", "--allow-read", "--allow-write", "--allow-net", "--unstable", "app.js"]

Build image docker build -t app . && docker run -it --init -p 8080:8080 app
... and see this errors:

If DB file NOT exist (Tested with CentOS & Alpine Linux)

alpine

If DB file exist

centOS

how can I fix this?

Bundle && remove error!

Hi!
i really liked your project and i would like to take it to my backend arsenal!
But i find two errors.

  1. If i run your example with import from https://deno.land/x/[email protected]/mod.ts - everything works fine!
    but if i made bundle with command "deno bundle https://deno.land/x/[email protected]/mod.ts dndb.js" and start again - i see this error.
    https://user-images.githubusercontent.com/75129392/102415925-5d273c80-403c-11eb-80a5-f50f4c94c6c2.jpg

  2. await remove({ _id: 'id2' }) dont work!
    https://user-images.githubusercontent.com/75129392/102416130-995a9d00-403c-11eb-809d-f5345df8e02e.jpg

JSON.parse error on big json

I'm getting error on find with big json, in my case the size was around 24K.

Evniroment
deno 1.9.2
dndb 0.3.3

db sample:

{"data":[{"sin":0,"cos":0.9950041652780257,"time":2},{"sin":0.19866933079506122,"cos":0.955336489125606,"time":4},{"sin":0.3894183423086505,"cos":0.8775825618903728,"time":6},{"sin":0.5646424733950355,"cos":0.7648421872844884,"time":8},{"sin":0.7173560908995228,"cos":0.6216099682706644,"time":10},{"sin":0.8414709848078965,"cos":0.4535961214255773,"time":12},{"sin":0.9320390859672264,"cos":0.26749882862458735,"time":14},{"sin":0.9854497299884603,"cos":0.0707372016677029,"time":16},{"sin":0.9995736030415051,"cos":-0.12884449429552486,"time":18},{"sin":0.9738476308781951,"cos":-0.3232895668635035,"time":20},{"sin":0.9092974268256817,"cos":-0.5048461045998576,"time":22},{"sin":0.8084964038195901,"cos":-0.6662760212798244,"time":24},{"sin":0.6754631805511506,"cos":-0.8011436155469337,"time":26},{"sin":0.5155013718214642,"cos":-0.9040721420170612,"time":28},{"sin":0.33498815015590466,"cos":-0.9709581651495907,"time":30},{"sin":0.1411200080598672,"cos":-0.9991351502732795,"time":32},{"sin":-0.058374143427580086,"cos":-0.9874797699088649,"time":34},{"sin":-0.25554110202683167,"cos":-0.9364566872907963,"time":36},{"sin":-0.44252044329485246,"cos":-0.848100031710408,"time":38},{"sin":-0.6118578909427193,"cos":-0.7259323042001399,"time":40},{"sin":-0.7568024953079282,"cos":-0.5748239465332685,"time":42},{"sin":-0.8715757724135882,"cos":-0.40079917207997545,"time":44},{"sin":-0.9516020738895161,"cos":-0.2107957994307797,"time":46},{"sin":-0.9936910036334645,"cos":-0.01238866346289056,"time":48},{"sin":-0.9961646088358406,"cos":0.18651236942257576,"time":50},{"sin":-0.9589242746631385,"cos":0.37797774271298107,"time":52},{"sin":-0.8834546557201531,"cos":0.5543743361791615,"time":54},{"sin":-0.7727644875559871,"cos":0.70866977429126,"time":56},{"sin":-0.6312666378723208,"cos":0.8347127848391598,"time":58},{"sin":-32.057550379549205,"cos":63.996011721338476,"time":60},{"sin":-19.279669375725884,"cos":67.84552225253834,"time":62},{"sin":-5.733168794407251,"cos":68.99024591045564,"time":64},{"sin":8.041895134684061,"cos":67.38454617523362,"time":66},{"sin":21.496354082423128,"cos":63.09243722823704,"time":68},{"sin":34.09382122856402,"cos":56.28503190864962,"time":70},{"sin":43.361115515440076,"cos":45.18007998522519,"time":72},{"sin":51.58841115019496,"cos":34.195038629771794,"time":74},{"sin":58.41602622775575,"cos":22.53129565927668,"time":76},{"sin":61.94685901001514,"cos":9.815927170423318,"time":78},{"sin":59.9126007224763,"cos":-2.760127538372217,"time":80},{"sin":59.361494797402905,"cos":-14.612649224147466,"time":82},{"sin":56.44383340078635,"cos":-25.88261069823725,"time":84},{"sin":51.27593448529683,"cos":-36.12071416108942,"time":86},{"sin":44.063825872446806,"cos":-44.91879873584399,"time":88},{"sin":35.0950315735057,"cos":-51.926112554466734,"time":90},{"sin":24.727109114505396,"cos":-56.86329612786671,"time":92},{"sin":13.373394846014754,"cos":-59.53351952715621,"time":94},{"sin":1.486525527201466,"cos":-59.83032937178271,"time":96},{"sin":-10.459606873378885,"cos":-57.74189278987859,"time":98},{"sin":-21.988747755115703,"cos":-53.35146915752165,"time":100},{"sin":-32.64126665336219,"cos":-46.834090810150954,"time":102},{"sin":-41.99248125561262,"cos":-38.44958505569959,"time":104},{"sin":-49.66958814513922,"cos":-28.532215679759553,"time":106},{"sin":-55.366525296768444,"cos":-17.47735690328063,"time":108},{"sin":-58.85617380398949,"cos":-5.725731060057039,"time":110},{"sin":-59.999412393042206,"cos":6.254161611941919,"time":112},{"sin":-58.75066374907902,"cos":17.984720596620896,"time":114},{"sin":-55.15971153988054,"cos":28.998285525180354,"time":116},{"sin":-49.36971569812246,"cos":38.85578031923264,"time":118},{"sin":-41.611505086627346,"cos":47.16421776846236,"time":120},{"sin":-32.1943750800261,"cos":53.592366690559395,"time":122},{"sin":-21.49375693420962,"cos":57.88395707319659,"time":124},{"sin":-9.936250526898565,"cos":59.86789675071484,"time":126},{"sin":2.017382833268308,"cos":59.465092308855176,"time":128},{"sin":13.890589506092336,"cos":56.691602289591636,"time":130},{"sin":25.210022209598456,"cos":51.657996987738336,"time":132},{"sin":35.52441088243347,"cos":44.564950362220166,"time":134},{"sin":44.42255339714692,"cos":35.69523979859352,"time":136},{"sin":51.549708891389805,"cos":25.40247266703983,"time":138},{"sin":56.62174016664628,"cos":14.096989112389386,"time":140},{"sin":59.43644134169222,"cos":2.2295030874494777,"time":142},{"sin":59.88159916298169,"cos":-9.726866189983095,"time":144},{"sin":57.93946659295665,"cos":-21.295456007322297,"time":146},{"sin":53.6874703284302,"cos":-32.01506319534715,"time":148},{"sin":47.29512404251898,"cos":-41.45833084314755,"time":150},{"sin":39.01727040942701,"cos":-49.24878566956016,"time":152},{"sin":29.183921331227886,"cos":-55.07584682485759,"time":154},{"sin":18.187101404742137,"cos":-58.707207769133056,"time":156},{"sin":6.465219137966538,"cos":-59.99809760096039,"time":158},{"sin":-5.514411013660898,"cos":-58.897052616383064,"time":160},{"sin":-17.274198999903916,"cos":-55.447968004387775,"time":162},{"sin":-28.34531918390797,"cos":-49.788347884238945,"time":164},{"sin":-38.286400940877016,"cos":-42.14382345016281,"time":166},{"sin":-46.701124712057904,"cos":-32.81915776765414,"time":168},{"sin":-53.254022014890275,"cos":-22.186095831790187,"time":170},{"sin":-57.683849512773406,"cos":-10.668544267386938,"time":172},{"sin":-59.81400396249577,"cos":1.2743284904187608,"time":174},{"sin":-59.559562828237965,"cos":13.166397792687558,"time":176},{"sin":-56.93066987508744,"cos":24.53356436393279,"time":178},{"sin":-52.03213076913488,"cos":34.92265514412752,"time":180},{"sin":-45.05923480630057,"cos":43.9194898685368,"time":182},{"sin":-36.28996934437705,"cos":51.16539312785239,"time":184},{"sin":-26.07393732431361,"cos":56.37149362489536,"time":186},{"sin":-14.818419704197254,"cos":59.33024056164876,"time":188},{"sin":-2.9721384527020454,"cos":59.923678034610084,"time":190},{"sin":8.99263257977714,"cos":58.12814756443261,"time":192},{"sin":20.598895729193924,"cos":54.015231284838265,"time":194},{"sin":31.383945909461964,"cos":47.74889818883664,"time":196},{"sin":40.91781720408814,"cos":39.578967202407554,"time":198},{"sin":48.82042425042632,"cos":29.831147692272133,"time":200},{"sin":54.77671504365766,"cos":18.894054461276053,"time":202},{"sin":58.54923106601858,"cos":7.203714902545604,"time":204},{"sin":59.98757400856016,"cos":-4.7738140367124045,"time":206},{"sin":59.03440167711697,"cos":-16.56102607496823,"time":208},{"sin":55.727714044634425,"cos":-27.68800226495475,"time":210},{"sin":50.19933831216336,"cos":-37.71114517918128,"time":212},{"sin":42.669673374358794,"cos":-46.23086373951413,"time":214},{"sin":33.438903211059504,"cos":-52.90750365247945,"time":216},{"sin":22.875029499296406,"cos":-57.474888354103,"time":218},{"sin":11.399200547726265,"cos":-59.75093062954679,"time":220},{"sin":-0.5310785574242326,"cos":-59.64489185575571,"time":222},{"sin":-12.440185236405735,"cos":-57.16099946401611,"time":224},{"sin":-23.853340987286167,"cos":-52.39827840561094,"time":226},{"sin":-34.31553930657383,"cos":-45.54660333950325,"time":228},{"sin":-43.4096853626547,"cos":-36.87912892886802,"time":230},{"sin":-50.77322425051024,"cos":-26.74140002665999,"time":232},{"sin":-56.11259491167241,"cos":-15.537575892756676,"time":234},{"sin":-59.21493348723896,"cos":-3.7143176396652327,"time":236},{"sin":-59.95655952819766,"cos":8.257018736512759,"time":238},{"sin":-58.3079067446318,"cos":19.899173832195167,"time":240},{"sin":-54.334701720397426,"cos":30.748011662662254,"time":242},{"sin":-48.195343601637155,"cos":40.371023299100806,"time":244},{"sin":-40.1345892226813,"cos":48.38456963473527,"time":246},{"sin":-30.473795423437323,"cos":54.46917586537181,"time":248},{"sin":-19.598107566283332,"cos":58.38226794168001,"time":250},{"sin":-7.9411050058663815,"cos":59.96784323105373,"time":252},{"sin":4.0324843515287085,"cos":59.16268985027779,"time":254},{"sin":15.845311283068371,"cos":55.99890672383532,"time":256},{"sin":27.026435656523358,"cos":50.60262390108247,"time":258},{"sin":37.130101327202354,"cos":43.1889741492074,"time":260},{"sin":45.75350702877617,"cos":34.053516288692634,"time":262},{"sin":52.55286478865346,"cos":23.56045219583255,"time":264},{"sin":57.25710566956188,"cos":12.128107223230918,"time":266},{"sin":59.67868643267029,"cos":0.21225288809438353,"time":268},{"sin":59.72106629469354,"cos":-11.712063299887546,"time":270},{"sin":57.38255570427018,"cos":-23.169456483655956,"time":272},{"sin":52.756383699043354,"cos":-33.70315655286899,"time":274},{"sin":46.02698115813167,"cos":-42.89321812677991,"time":276},{"sin":37.46262812498348,"cos":-50.373262451353334,"time":278},{"sin":27.40475832865157,"cos":-55.845083764013104,"time":280},{"sin":16.254347298472144,"cos":-59.0905378163543,"time":282},{"sin":4.455926735061466,"cos":-59.98023859693259,"time":284},{"sin":-7.520137565785959,"cos":-58.478716543239464,"time":286},{"sin":-19.196397713051887,"cos":-54.645832601228754,"time":288},{"sin":-30.10735806123445,"cos":-48.634391758303835,"time":290},{"sin":-39.818033052778055,"cos":-40.684051190673514,"time":292},{"sin":-47.94128871957695,"cos":-31.11176588801875,"time":294},{"sin":-54.15327649261122,"cos":-20.299152658263313,"time":296},{"sin":-58.20634402243112,"cos":-8.677276269703187,"time":298},{"sin":-59.93890829681697,"cos":3.290535741001077,"time":300},{"sin":-59.28189744557171,"cos":15.127164475597628,"time":302},{"sin":-56.26150441801679,"cos":26.36072089908006,"time":304},{"sin":-50.99814275275957,"cos":36.54335856638137,"time":306},{"sin":-43.7016460698956,"cos":45.26912784687771,"time":308},{"sin":-34.6629026667439,"cos":52.190159855112654,"time":310},{"sin":-24.2422587193839,"cos":57.03053488549754,"time":312},{"sin":-12.855152417753054,"cos":59.59728246025759,"time":314},{"sin":-0.9555517560058948,"cos":59.78807445342749,"time":316},{"sin":10.98214373883528,"cos":57.59530459031846,"time":318},{"sin":22.48201581896772,"cos":53.10639168568729,"time":320},{"sin":33.08560087450144,"cos":46.50029453145777,"time":322},{"sin":42.37016743082007,"cos":38.0403773744238,"time":324},{"sin":49.96556911846679,"cos":28.063910414824417,"time":326},{"sin":55.56900124083171,"cos":16.968623907776134,"time":328},{"sin":58.95707264184845,"cos":5.196851913114451,"time":330},{"sin":59.99471160643603,"cos":-6.782102167708968,"time":332},{"sin":58.64055074353552,"cos":-18.49067523726683,"time":334},{"sin":54.94857617344914,"cos":-29.462083435814428,"time":336},{"sin":49.06597527158651,"cos":-39.258931340757094,"time":338},{"sin":41.227268772284354,"cos":-47.490649541865416,"time":340},{"sin":31.74496116720143,"cos":-53.8290654111507,"time":342},{"sin":20.99708213739973,"cos":-58.021486309932165,"time":344},{"sin":9.4121157029046,"cos":-59.900773646924534,"time":346},{"sin":-2.5480820830170914,"cos":-59.392006166436204,"time":348},{"sin":-14.406695877226884,"cos":-56.51546682240564,"time":350},{"sin":-25.690960169769063,"cos":-51.385834161034325,"time":352},{"sin":-35.95100695285591,"cos":-44.20761044903926,"time":354},{"sin":-44.777800538694976,"cos":-35.266968813623215,"time":356},{"sin":-51.81944452157736,"cos":-24.920344422963414,"time":358},{"sin":-56.795210777097765,"cos":-13.580224540854818,"time":360},{"sin":-59.50673120658695,"cos":-1.698703961178639,"time":362},{"sin":-59.845906047218875,"cos":10.250538584859399,"time":364},{"sin":-57.79921346842565,"cos":21.79112450496374,"time":366},{"sin":-53.44824864461168,"cos":32.462967056925464,"time":368},{"sin":-46.966470813038995,"cos":41.840613555143726,"time":370},{"sin":-38.61228800141997,"cos":49.55020682661,"time":372},{"sin":-28.718755115304898,"cos":55.284389716619,"time":374},{"sin":-17.680296090015453,"cos":58.81455844860649,"time":376},{"sin":-5.936979453017373,"cos":59.999976335319985,"time":378},{"sin":6.043025819550457,"cos":58.79338450641861,"time":380},{"sin":17.78211472256312,"cos":55.242885970499884,"time":382},{"sin":28.81228682629554,"cos":49.49002789994484,"time":384},{"sin":38.693803976692365,"cos":41.76415859183338,"time":386},{"sin":47.03272126789758,"cos":32.37328407508895,"time":388},{"sin":53.49659238248663,"cos":21.69178888207615,"time":390},{"sin":57.827723177045264,"cos":10.145510518733582,"time":392},{"sin":59.85344513446831,"cos":-1.805237332981475,"time":394},{"sin":59.4929991128484,"cos":-13.684016068985974,"time":396},{"sin":56.76075495761449,"cos":-25.01725626673022,"time":398},{"sin":51.76563862114051,"cos":-35.353137403637284,"time":400},{"sin":44.70678962876093,"cos":-44.279600515537446,"time":402},{"sin":35.865622014315285,"cos":-51.44077568724312,"time":404},{"sin":25.594605230674002,"cos":-56.551169463052986,"time":406},{"sin":14.303212304933524,"cos":-59.40704656990596,"time":408},{"sin":2.4415954409914655,"cos":-59.894552199792955,"time":410},{"sin":-9.51736012828254,"cos":-57.994251041663475,"time":412},{"sin":-21.09688858300898,"cos":-53.78190210594492,"time":414},{"sin":-31.835350665012577,"cos":-47.425438451868935,"time":416},{"sin":-41.30463777826022,"cos":-39.178272226342074,"time":418},{"sin":-49.12723932761086,"cos":-29.369191921338306,"time":420},{"sin":-54.991292874938026,"cos":-18.38925461427564,"time":422},{"sin":-58.663017110401256,"cos":-6.676195756390079,"time":424},{"sin":-59.996031975528226,"cos":5.303021958348333,"time":426},{"sin":-58.93719437421807,"cos":17.07082492226132,"time":428},{"sin":-55.52871682027968,"cos":28.158067966626906,"time":430},{"sin":-49.9064845577159,"cos":38.12273769908457,"time":432},{"sin":-42.29463824485489,"cos":46.567574182735626,"time":434},{"sin":-32.996638173620504,"cos":53.1559084361989,"time":436},{"sin":-22.38316626531733,"cos":57.62508436348027,"time":438},{"sin":-10.877348152181268,"cos":59.79693002365894,"time":440},{"sin":1.0621155063248147,"cos":59.584860783918934,"time":442},{"sin":12.959235971293445,"cos":56.997331175625504,"time":444},{"sin":24.33971259332054,"cos":52.1374978388396,"time":446},{"sin":34.74984168265625,"cos":45.199106992607625,"time":448},{"sin":43.7746042435715,"cos":36.45877038461053,"time":450},{"sin":51.05421147204711,"cos":26.264937653682424,"time":452},{"sin":56.298448400013264,"cos":15.024004742305303,"time":454},{"sin":59.298243850298284,"cos":3.1841121728414743,"time":456},{"sin":59.93400544470126,"cos":-8.782720900906952,"time":458},{"sin":58.18038737471514,"cos":-20.399414607814712,"time":460},{"sin":54.107300858928554,"cos":-31.202848028383855,"time":462},{"sin":47.877127003357856,"cos":-40.76232236434265,"time":464},{"sin":39.73824317917425,"cos":-48.696731540581474,"time":466},{"sin":30.01512100071522,"cos":-54.689755701720294,"time":468},{"sin":19.09539066614889,"cos":-58.50247188653554,"time":470},{"sin":7.41438736471344,"cos":-59.98287913246029,"time":472},{"sin":-4.562204163501214,"cos":-59.07195827429486,"time":474},{"sin":-16.356915008584835,"cos":-55.80602485207735,"time":476},{"sin":-27.499527269505954,"cos":-50.315281325102475,"time":478},{"sin":-37.54582015796875,"cos":-42.818626310747625,"time":480},{"sin":-46.09527967942001,"cos":-33.61492778737258,"time":482},{"sin":-52.807065862119714,"cos":-23.071108171153437,"time":484},{"sin":-57.413600971229386,"cos":-11.607516277242732,"time":486},{"sin":-59.731236988710926,"cos":0.3188306610062573,"time":488},{"sin":-59.66757708027088,"cos":12.23246682692926,"time":490},{"sin":-57.225159165568314,"cos":23.65843314224348,"time":492},{"sin":-52.5013547393668,"cos":34.141212386679896,"time":494},{"sin":-45.684486977312176,"cos":43.26288923208493,"time":496},{"sin":-37.04632288520771,"cos":50.65981120774877,"time":498},{"sin":-26.93123880610189,"cos":56.03708637683843,"time":500},{"sin":-15.742491222235726,"cos":59.18033974733532,"time":502},{"sin":-3.9261401916424172,"cos":59.96425972646752,"time":504},{"sin":8.046733658739852,"cos":58.35759389846953,"time":506},{"sin":19.698809631084202,"cos":54.424394959776315,"time":508},{"sin":30.56555622662612,"cos":48.321467140146595,"time":510},{"sin":40.213750550602484,"cos":40.292114912846905,"time":512},{"sin":48.25874954195484,"cos":30.65644321309296,"time":514},{"sin":54.37982447836001,"cos":19.79859586443421,"time":516},{"sin":58.33294741827234,"cos":8.151440976742242,"time":518},{"sin":59.96051982487863,"cos":-3.8206861393329428,"time":520},{"sin":59.19765552242912,"cos":-15.640494555904832,"time":522},{"sin":56.074767503304884,"cos":-26.8367658109679,"time":524},{"sin":50.71635545798538,"cos":-36.963139901459094,"time":526},{"sin":43.336042365270785,"cos":-45.61591024801256,"time":528},{"sin":34.228058018242336,"cos":-52.45011820230665,"time":530},{"sin":23.75550901091005,"cos":-57.193305459793834,"time":532},{"sin":12.33590282415607,"cos":-59.65637611251139,"time":534},{"sin":0.4245031199954299,"cos":-59.74113530620419,"time":536},{"sin":-11.50382018396195,"cos":-57.44420395929283,"time":538},{"sin":-22.973522479589025,"cos":-52.85715347619259,"time":540},{"sin":-33.527342931096975,"cos":-46.16285508439012,"time":542},{"sin":-42.74453402159124,"cos":-37.628189335685924,"time":544},{"sin":-50.257635428821885,"cos":-27.59340642078622,"time":546},{"sin":-55.76712350864496,"cos":-16.45856146791871,"time":548},{"sin":-59.053352357513326,"cos":-4.667565607319385,"time":550},{"sin":-59.98531040151719,"cos":7.309511364688321,"time":552},{"sin":-58.525843414405855,"cos":18.995181185083293,"time":554},{"sin":-54.73313573934098,"cos":29.92357307438914,"time":556},{"sin":-48.75839066274648,"cos":39.659006534514845,"time":558},{"sin":-40.83980241642736,"cos":47.813360555341625,"time":560},{"sin":-31.293060125214712,"cos":54.06154677461106,"time":562},{"sin":-20.49876227777109,"cos":58.15446972505313,"time":564},{"sin":-8.88724346589776,"cos":59.92895748459868,"time":566},{"sin":3.0785816976419698,"cos":59.31426682599469,"time":568},{"sin":14.921673523923468,"cos":56.334903526031056,"time":570},{"sin":26.169885314869497,"cos":51.10964539755298,"time":572},{"sin":36.37478636216074,"cos":43.84680699288696,"time":574},{"sin":45.12953946446875,"cos":34.83593476001562,"time":576},{"sin":52.08512024282529,"cos":24.43626373941123,"time":578},{"sin":56.964231641202204,"cos":13.062395996605927,"time":580},{"sin":59.57235888507223,"cos":1.167771746190593,"time":582},{"sin":59.80552417164391,"cos":-10.773407878628932,"time":584},{"sin":57.65443193673711,"cos":-22.285085728781645,"time":586},{"sin":53.204839439593684,"cos":-32.9083275355829,"time":588},{"sin":46.63413789157332,"cos":-42.21961817177318,"time":590},{"sin":38.20428042834827,"cos":-49.8477458631641,"time":592},{"sin":28.2513388650232,"cos":-55.48860123064936,"time":594},{"sin":17.172105573404806,"cos":-58.9173011714754,"time":596},{"sin":5.408274622287927,"cos":-59.9971542388901,"time":598},{"sin":-6.571167171222497,"cos":-58.68511009876885,"time":600},{"sin":-18.288637266133,"cos":-55.03347581058376,"time":602},{"sin":-29.276997106375454,"cos":-49.18783051000615,"time":604},{"sin":-39.098175460893614,"cos":-41.38122162816998,"time":606},{"sin":-47.36063294121307,"cos":-31.92487402601461,"time":608},{"sin":-53.73497144128639,"cos":-21.195782441207747,"time":610},{"sin":-57.967066200503574,"cos":-9.621681897629696,"time":612},{"sin":-59.88819695596222,"cos":2.336004740234239,"time":614},{"sin":-59.42177428692068,"cos":14.200562240793857,"time":616},{"sin":-56.58639299331192,"cos":25.498988137278946,"time":618},{"sin":-51.49509077974885,"cos":35.780849843440905,"time":620},{"sin":-44.350841798953375,"cos":44.636241979345634,"time":622},{"sin":-35.438464712807935,"cos":51.71212800534108,"time":624},{"sin":-25.11326787110514,"cos":56.72641467481989,"time":626},{"sin":-13.786884288881282,"cos":59.47919820176692,"time":628},{"sin":-1.910861137088576,"cos":59.86073379387332,"time":630},{"sin":10.041342018168415,"cos":57.855810831087105,"time":632},{"sin":21.593228554448565,"cos":53.54435926503414,"time":634},{"sin":32.28426120963593,"cos":47.09826306408108,"time":636},{"sin":41.68822224927235,"cos":38.77450774192661,"time":638},{"sin":49.4302054226233,"cos":28.904935156136354,"time":640},{"sin":55.201562291807434,"cos":17.883014020468465,"time":642},{"sin":58.77220707102057,"cos":6.148153548919418,"time":644},{"sin":59.99978942073639,"cos":-5.831814403005408,"time":646},{"sin":58.83536950653187,"cos":-17.57928631803696,"time":648},{"sin":55.325369075847135,"cos":-28.62592756221426,"time":650},{"sin":49.6097207694062,"cos":-38.53134340882422,"time":652},{"sin":41.91628944841584,"cos":-46.90063618640924,"time":654},{"sin":32.55178794161745,"cos":-53.40014860275878,"time":656},{"sin":21.88954937269375,"cos":-57.77076560822982,"time":658},{"sin":10.354643546749088,"cos":-59.838244495093754,"time":660},{"sin":-1.5930692414380077,"cos":-59.52016140443821,"time":662},{"sin":-13.477271386189667,"cos":-56.829197305318665,"time":664},{"sin":-24.824177250763164,"cos":-51.87263244453837,"time":666},{"sin":-35.181421505570015,"cos":-44.84806942175184,"time":668},{"sin":-44.136093506344764,"cos":-36.035555397387085,"time":670},{"sin":-51.33119873851933,"cos":-25.78641749609942,"time":672},{"sin":-56.47989106195379,"cos":-14.50925650298906,"time":674},{"sin":-59.376908361350964,"cos":-2.653657239710335,"time":676},{"sin":-59.906755699050635,"cos":9.307734963615976,"time":678},{"sin":-58.04830973372889,"cos":20.898057146199093,"time":680},{"sin":-53.87566084135748,"cos":31.655239737996098,"time":682},{"sin":-47.555159365720264,"cos":41.150427815324086,"time":684}],"_id":"10e23eb0-b035-11eb-9364-173bcc8ef63b"}

Error

error: Uncaught (in promise) SyntaxError: Unexpected end of JSON input
      let doc: object = JSON.parse(decoder.decode(line.line));
                             ^
    at JSON.parse (<anonymous>)
    at ReadFileStream.stream (https://deno.land/x/[email protected]/src/storage.ts:76:30)

Cannot load multiples instance if db files needs to be created

It seems it is not possible to use multiple instances at once when files needs to be created:

import Datastore from 'https://deno.land/x/[email protected]/mod.ts'

const a = new Datastore({filename:"a", autoload:true})
const b = new Datastore({filename:"b", autoload:true})
console.log(await b.findOne({}))

Will result in:

error: Uncaught (in promise) NotFound: The system cannot find the file specified. (os error 2)
    const file = await Deno.open(this.filename);

Running it twice (i.e. when "a" file is already created) will work.

deno 1.11.2 (release, x86_64-pc-windows-msvc)
v8 9.1.269.35
typescript 4.3.2

dndb HANDLE 5m data

will dndb HANDLE 5m database data, approximately 5 gb data?
I watched it only create one file and read write on it, if lots of data comes then will it able to handle. OR I will face slow database .

Thoughts on typed data?

I love the memory-efficient reads/writes of dndb but also love the "typescript by default" nature of Deno. Would you be interested in some help implementing something that looks like:

const db = new Datastore<{ name: string, age: number }>({ filename:"./database.db", autoload: true })

Module not found "https://deno.land/std/io/bufio.ts"

Hello,

@denyncrawford, the following code :

import Datastore from 'https://deno.land/x/[email protected]/mod.ts'

throws the following error :

error: Module not found "https://deno.land/std/io/bufio.ts".
    at https://deno.land/x/[email protected]/deps.ts:5:27

@AmateurPotion, since you recently updated your fork, I'm guessing you fixed that, but how to import your module ?

The following code :

import Datastore from 'https://raw.githubusercontent.com/AmateurPotion/dndb/main/mod.ts'

throws the following error :

error: Relative import path "dndb/executor.ts" not prefixed with / or ./ or ../
    at https://raw.githubusercontent.com/AmateurPotion/dndb/main/src/mod.ts:15:22

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.