Code Monkey home page Code Monkey logo

nexaorm's Introduction

Get Started

Introduction

NexaORM is a modern PHP Object-Relational Mapping (ORM) library designed to simplify database interactions and streamline the development of PHP applications. It provides a lightweight and intuitive way to manage database entities, relationships, and queries.

Features

  • Attribute Annotations (Entities): Define entity properties using expressive annotations, making it easy to map database columns to PHP properties.

  • Models: Provide a foundation for representing and managing data objects within the application.

  • Simplified Query Building: Construct database queries effortlessly with a simple and intuitive query builder.

  • Relationships: Define and work with relationships between entities using straightforward annotations.

  • Auto-Migration: NexaORM includes an auto-migration feature that simplifies the process of updating the database schema to match changes in entity definitions.

  • Flexible Configuration: NexaORM is designed with flexibility in mind, allowing developers to adapt the library to their specific project requirements.

Why NexaORM?

Intelligent Auto-Generated Migrations:

Say goodbye to tedious manual migration creation! NexaORM's intelligent auto-generation feature analyzes your entities and creates the necessary migrations to update your database schema accordingly. This powerful feature offers several benefits:

  • Save Time and Effort: Eliminate the time-consuming and error-prone process of writing migrations manually.

  • Reduced Errors: Ensure consistency between your entities and database schema, minimizing the risk of errors and data inconsistencies.

  • Efficient Development: Streamline your development workflow by automating a crucial step in database management.

  • Effortless Database Management: NexaORM takes database management to the next level by simplifying and automating various tasks:

  • Automatic Schema Updates: Easily update your database schema to match your evolving entities without manual intervention.

  • Rollback Support: Safely revert to a previous database version if necessary, providing a safety net in case of unexpected issues.

  • Version Control Integration: Integrate your migrations with version control systems, enabling seamless collaboration and tracking of changes.

Seamless Integration:

NexaORM seamlessly integrates with your existing development environment:

  • Works with Any Framework: Use NexaORM with any PHP framework, including Laravel, Symfony, and CodeIgniter.
  • Flexible Configuration: Customize NexaORM's behavior to match your specific project requirements.
  • Extensible Architecture: Extend NexaORM's functionality with custom plugins and modules.

Community and Support:

Join a vibrant community of developers and contributors who actively support NexaORM:

  • Detailed Documentation: Access comprehensive documentation covering all aspects of NexaORM usage.
  • Responsive Support: Get help and answers to your questions from the NexaORM community and maintainers.
  • Continuous Development: Benefit from regular updates and new features driven by the active NexaORM community.

Choose NexaORM and unlock the power of intelligent auto-generated migrations, effortless database management, seamless integration, and a supportive community. Embrace a more efficient and error-free development workflow for your PHP applications.

Installation

Use Composer to install the package:

composer require v1p3r75/nexa-orm

Preview

// Define entity

#[Entity]
class UserEntity
{

  #[PrimaryKey]
  #[SmallInt]
  #[AutoIncrement(true)]
  public int $id;

  #[Strings]
  #[DefaultValue('John')]
  public string $username;

  #[Number]
  #[ForeignKey(ProfileEntity::class, 'id', [Nexa::ON_DELETE => Nexa::CASCADE, Nexa::ON_UPDATE => Nexa::CASCADE])]
  #[Comment('user profile')]
  #[Nullable]
  public int $profile;

  #[DateAndTime]
  #[DefaultValue(Nexa::DATETIME_NOW)]
  public DateTime $created_at;
}
// Create a model for database interation


use Nexa\Models\Model;
use Nexa\Test\Entities\UserEntity;

class User extends Model
{

  protected $entity = UserEntity::class;

}

User::insert(['username' => 'John Doe', 'email' => '[email protected]'])

Authors

Resources

nexaorm's People

Contributors

v1p3r75 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

blakvghost

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.