• Saving data in custom module

    From Sam Alexander@VERT/BAUDOT to All on Fri Mar 25 15:13:06 2022
    I'm probably overlooking this in the docs, but if I'm building a custom module how can I save data back to the Synchronet database or elsewhere? I'm still really foggy in how Sync saves data to the file system. I'm playing with some ideas for custom modules which will need to save data back, just not sure howãto do this.ããAppriciate the input.ãã---ã þ Synchronet þ Camping on the Internet at Camp Baudot BBS - campbaudot.comã
  • From echicken@VERT/ECBBS to Sam Alexander on Fri Mar 25 16:32:44 2022
    Re: Saving data in custom moduleã By: Sam Alexander to All on Fri Mar 25 2022 15:13:06ãã SA> I'm probably overlooking this in the docs, but if I'm building a customã SA> module how can I save data back to the Synchronet database or elsewhere?ã SA> I'm still really foggy in how Sync saves data to the file system. I'mã SA> playing with some ideas for custom modules which will need to save dataã SA> back, just not sure how to do this. ããThere are a lot of different ways. Synchronet and its modules don't store all of their data in any one place following any one format.ããThe exec/load/userprops.js library lets you set per-user keys and values arbitrarily.ããThe built-in File class lets you do typical file IO stuff. It's documented in jsobjs.html* and there are many usage examples in exec/. Create your own file wherever you like and put whatever you want in it. You can use it with ini files and with JSON.parse/JSON.stringify if you like.ããThere's the JSON-DB service, which lets you share a JS object among multiple clients including remote BBSs. Has a subscription feature so it'll push real-time updates to clients.ããThe user, message, and file databases can all be interacted with from JS. See the User class, the MsgBase class, the FileBase class in jsobjs.html*.ãã* https://synchro.net/docs/jsobjs.htmlã ã--- ãechicken ãelectronic chicken bbs - bbs.electronicchicken.comã---ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From Nightfox@VERT/DIGDIST to Sam Alexander on Fri Mar 25 09:28:51 2022
    Re: Saving data in custom moduleã By: Sam Alexander to All on Fri Mar 25 2022 03:13 pmãã SA> I'm probably overlooking this in the docs, but if I'm building a customã SA> module how can I save data back to the Synchronet database or elsewhere?ã SA> I'm still really foggy in how Sync saves data to the file system. I'mã SA> playing with some ideas for custom modules which will need to save dataã SA> back, just not sure how to do this. ããI don't know of a general "Synchronet database" for generic data, but its JavaScript has a File class that you could use to write data to a file on the drive:ãhttp://www.synchro.net/docs/jsobjs.html#File_classããNightfoxãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã
  • From Andre@VERT/RDOMENTR to echicken on Fri Mar 25 14:17:56 2022
    Re: Saving data in custom moduleã By: echicken to Sam Alexander on Fri Mar 25 2022 04:32 pmãã ec> There are a lot of different ways. Synchronet and its modules don't storeã ec> all of their data in any one place following any one format. ããLemme go quick make a gitlab issue for "Windows Registry style of data storage."ããã- Andreãã---ã þ Synchronet þ Radio Mentor BBS - bbs.radiomentor.orgã
  • From Nightfox@VERT/DIGDIST to Andre on Fri Mar 25 13:46:11 2022
    Re: Saving data in custom moduleã By: Andre to echicken on Fri Mar 25 2022 02:17 pmãã ec>> There are a lot of different ways. Synchronet and its modules don'tã ec>> store all of their data in any one place following any one format. ãã An> Lemme go quick make a gitlab issue for "Windows Registry style of dataã An> storage." ããhttps://youtu.be/31g0YE61PLQããNightfoxãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã
  • From Ragnarok@VERT/DOCKSUD to Andre on Wed Mar 30 19:15:25 2022
    El 25/3/22 a las 16:17, Andre escribió:
    Re: Saving data in custom module
    By: echicken to Sam Alexander on Fri Mar 25 2022 04:32 pm

    ec> There are a lot of different ways. Synchronet and its modules don't store
    ec> all of their data in any one place following any one format.

    Lemme go quick make a gitlab issue for "Windows Registry style of data storage."


    you can use ini style files too and your future module can be more
    portable, windows registry sucks

    ---
    ï¿­ Synchronet ï¿­ Dock Sud BBS TLD 24 HS - bbs.docksud.com.ar