- Corrigido bug relacionado à sincronização entre disco e memória.
- Corrigido o link do logotipo na documentação em português.
- Lançada a versão com a correção no npm.
- Adicionada uma categoria de documentação em português à página do GitHub.
- Um link para esta documentação foi adicionado ao README.
- Corrigido um bug no sistema de genéricos que garante a intellisense nas coleções.
- Modificada a estrutura de arquivo de alterações.
- Atualizado o README para adicionar uma referência à nova Estratégia de Armazenamento (TypedJson).
- Adicionado um novo modelo de armazenamento: TypedJson.
- Características:
Agora, quando um esquema existe, todos os dados inseridos/atualizados são verificados.
Se o tipo de um dado ou uma chave que não existe no esquema é fornecido no Documento, um erro será gerado.
Casos complexos foram testados, como: { value: [ { key: String(), xxx: [ Number() ] } ], required: Boolean() }.
- Dado este exemplo, em tempo de execução, cada documento será testado em busca dos seguintes requisitos:
- required: se existir no Documento anterior, deve ser um booleano.
- value: se existir no documento, deve ser um array.
Cada valor dentro deste array deve ser um objeto:
- key: se existir no objeto, deve ser uma string.
- xxx: se existir no objeto, deve ser um array de números.
Vários casos foram testados e, aparentemente, a função de validação '(utils/validateSchema.js)' está funcionando corretamente.
- Corrigido o arquivo .npmignore.
- A API de Armazenamento foi aprimorada com a opção de substituir as funções disponíveis na API de Coleções.
- Isso visa principalmente permitir métodos mais complexos em Armazenamentos mais intricados.
- Corrigido o arquivo .npmignore.
- Reformulação de toda a API.
- A biblioteca foi dividida em vários módulos.
- Core
- MycroDatabase: A classe principal da biblioteca, usada para construir o wrapper de acesso ao banco de dados.
- Collection: Uma classe que representa uma coleção e fornece acesso aos seus métodos de manipulação.
- Storage:
- Memory: Uma classe que representa um banco de dados em memória.
- JSON: Uma classe que representa um banco de dados baseado em disco no formato JSON.
- Adicionado um 'site estático' usando as Páginas do Github.
- Removido o antigo script de compilação.
- 'insert' agora aceita vários documentos, tornando mais simples a inserção de vários documentos de uma vez.
- Exemplo: `db.collection('users', {id: 0, name: "", age: 0}).insert([{name: "John Doe", age: 20}, {name: "Jane Doe, age: 30}])`
- 'insert', 'update' e 'remove' agora retornam a lista de IDs relacionados aos documentos afetados (criados, modificados e removidos).
- Melhorias gerais na validação de argumentos para funções.
- Testes atualizados para refletir as mudanças.
- Documentação do README atualizada.
- Re-added the 'project overview' label in the README.
- Added a Logo in the README.
- Added Remove and Update methods to the Collections API.
- Complete rewrite of the library's tests.
- Each function is in its own file.
- README has been updated to reflect the new changes.
- Removed all Rollup build tooling.
- The library is 'self-contained' and does not require a separate build process (for now).
- Updated the package.json to reflect the changes.
- Fixed a minor 'import' example error in the README.
- Old: import MycroDatabase from 'mycro-db'
- New: import { MycroDatabase } from 'mycro-db
- The collections system is now stable.
- When you create a collection, it has its own in-memory space to save its objects.
- Objects are still indexed using auto-generated IDs.
- All collection-related information is also saved to disk.
- No changes were made to the APIs, which still include Insert and Query for each collection, and Sync for the database.
- Tests have been updated to reflect the changes.
- Modified the type of the 'filter' parameter in db.collection.query.
- Now, the IDE can provide 'intellisense' for the 'doc' that exists inside the collection.
- Example: db.collection('users', {id: 0, name: "", age: 0}).query((doc) => doc.name === "John Doe")
- The IDE knows that 'doc' is of type {id: number, name: string, age: number}.
- When defining a collection, it now checks if the required arguments are being passed for collection creation.
- There is no type checking on these arguments.
- The implementation of 'saving collection schemas' to the on-disk database has begun.
- Update README to reflect API changes.
- Implemented the initial version of the Collections API.
- Removed direct access to Insert and Query.
- When defining a Collection, you should now pass (with a plain JavaScript object) what you want to be the Schema for that collection.
- Example: db.collection('users', {id: 0, name: "", age: 0})
- This will ensure that when users access the Insert and Query methods using the collection, the IDE will know that the 'Document' in this collection has the type: {id: number, name: string, age: number}, and provide auto-completion (intellisense) for the user.
- To use Insert and Query, you should first create a collection.
- Example: const User = db.collection('users', {id: 0, name: "", age: 0})
- User.insert({name: "John Doe", age: 20})
- User.query((doc) => doc.name === "John Doe")
- Sync remains at the database level.
- Example: db.sync()
- Tests have been modified in accordance with the above changes.
- Added the Rollup package with some plugins for the project compilation process.
- Modified the package.json to fix the library import issue in other projects.
- Revamped the project README to include the current MycroDB API information.
- Added the LICENSE file.
- Added the .npmignore file to prevent unnecessary files from being included with the library during packaging.
- Added the 'ava' package as a development dependency for testing.
- Implemented the initial approach for the Database.
- The library exports the 'MycroDatabase' class.
- When constructing this class, it takes a path to the JSON file.
- An object with 'Insert,' 'Query,' and 'Sync' functions is returned:
- Insert: Receives a document (object) and inserts it (in memory) into the database.
- Query: Receives an expression to be used as a filter (in a filter) on the database values.
- Sync: Synchronizes the in-memory data with the on-disk file.
- There are other private functions and properties that are not part of the MycroDatabase object's API:
- __load
-__save
- __nextId
-__filePath
- __memory
-__id
- GitHub repository created with some configuration files and initial project structure.
- Package published on npm.