nodes: 0, module; 1, function_definition; 2, function_name:last; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, dictionary_splat_pattern; 8, expression_statement; 9, return_statement; 10, identifier:limit; 11, integer:1; 12, identifier:kwargs; 13, comment:"""
          Returns the last `limit` records inserted in the model's table in the replica database. Rows are sorted by ``created_at``.
          """; 14, call; 15, attribute; 16, argument_list; 17, identifier:self; 18, identifier:collection_instance; 19, call; 20, attribute; 21, argument_list; 22, call; 23, identifier:select; 24, keyword_argument; 25, keyword_argument; 26, keyword_argument; 27, attribute; 28, argument_list; 29, identifier:where; 30, string; 31, identifier:order; 32, string; 33, identifier:limit; 34, identifier:limit; 35, identifier:self; 36, identifier:db_adapter; 37, keyword_argument; 38, keyword_argument; 39, string_content:created_at IS NOT NULL; 40, string_content:created_at DESC; 41, identifier:db_name; 42, call; 43, identifier:role; 44, call; 45, attribute; 46, argument_list; 47, attribute; 48, argument_list; 49, identifier:kwargs; 50, identifier:get; 51, string; 52, identifier:kwargs; 53, identifier:get; 54, string; 55, string; 56, string_content:db; 57, string_content:role; 58, string_content:replica
code: def last(self, limit=1, **kwargs):
          """
          Returns the last `limit` records inserted in the model's table in the replica database. Rows are sorted by ``created_at``.
          """
          return self.collection_instance(
              self.db_adapter(
                  db_name=kwargs.get('db'),
                  role=kwargs.get('role', 'replica')
                  ).select(
                      where='created_at IS NOT NULL',
                      order='created_at DESC',
                      limit=limit
                      )
                  )